From 4be8417f1797c7039390157ff75d2e8875efa0d8 Mon Sep 17 00:00:00 2001 From: Qian Gao Date: Wed, 24 Jun 2015 00:08:50 -0700 Subject: [PATCH] Storwize: add the missing stops in the end of the messages This patch adds the missing stops in the end of log or exception messages, where necessary. Change-Id: Ib18f36f66544cb5f907b69fdc8587f48948a971a Closes-Bug: #1468203 --- .../drivers/ibm/storwize_svc/__init__.py | 40 +++---- .../drivers/ibm/storwize_svc/helpers.py | 106 +++++++++--------- .../drivers/ibm/storwize_svc/replication.py | 6 +- cinder/volume/drivers/ibm/storwize_svc/ssh.py | 21 ++-- 4 files changed, 87 insertions(+), 86 deletions(-) diff --git a/cinder/volume/drivers/ibm/storwize_svc/__init__.py b/cinder/volume/drivers/ibm/storwize_svc/__init__.py index 508e8b2e1..d591a6fe6 100644 --- a/cinder/volume/drivers/ibm/storwize_svc/__init__.py +++ b/cinder/volume/drivers/ibm/storwize_svc/__init__.py @@ -179,7 +179,7 @@ class StorwizeSVCDriver(san.SanDriver): try: self._helpers.get_pool_attrs(pool) except exception.VolumeBackendAPIException: - msg = _('Failed getting details for pool %s') % pool + msg = _('Failed getting details for pool %s.') % pool raise exception.InvalidInput(reason=msg) # Check if compression is supported @@ -248,17 +248,17 @@ class StorwizeSVCDriver(san.SanDriver): # Check that we have the system ID information if self._state['system_name'] is None: - exception_msg = (_('Unable to determine system name')) + exception_msg = (_('Unable to determine system name.')) raise exception.VolumeBackendAPIException(data=exception_msg) if self._state['system_id'] is None: - exception_msg = (_('Unable to determine system id')) + exception_msg = (_('Unable to determine system id.')) raise exception.VolumeBackendAPIException(data=exception_msg) required_flags = ['san_ip', 'san_ssh_port', 'san_login', 'storwize_svc_volpool_name'] for flag in required_flags: if not self.configuration.safe_get(flag): - raise exception.InvalidInput(reason=_('%s is not set') % flag) + raise exception.InvalidInput(reason=_('%s is not set.') % flag) # Ensure that either password or keyfile were set if not (self.configuration.san_password or @@ -266,7 +266,7 @@ class StorwizeSVCDriver(san.SanDriver): raise exception.InvalidInput( reason=_('Password or SSH private key is required for ' 'authentication: set either san_password or ' - 'san_private_key option')) + 'san_private_key option.')) # Check that flashcopy_timeout is not more than 10 minutes flashcopy_timeout = self.configuration.storwize_svc_flashcopy_timeout @@ -274,7 +274,7 @@ class StorwizeSVCDriver(san.SanDriver): raise exception.InvalidInput( reason=_('Illegal value %d specified for ' 'storwize_svc_flashcopy_timeout: ' - 'valid values are between 0 and 600') + 'valid values are between 0 and 600.') % flashcopy_timeout) opts = self._helpers.build_default_opts(self.configuration) @@ -290,7 +290,7 @@ class StorwizeSVCDriver(san.SanDriver): """ volume_defined = self._helpers.is_vdisk_defined(volume['name']) if not volume_defined: - LOG.error(_LE('ensure_export: Volume %s not found on storage'), + LOG.error(_LE('ensure_export: Volume %s not found on storage.'), volume['name']) def create_export(self, ctxt, volume): @@ -368,12 +368,12 @@ class StorwizeSVCDriver(san.SanDriver): chap_secret = self._helpers.add_chap_secret_to_host(host_name) elif not chap_enabled and chap_secret: LOG.warning(_LW('CHAP secret exists for host but CHAP is ' - 'disabled')) + 'disabled.')) volume_attributes = self._helpers.get_vdisk_attributes(volume_name) if volume_attributes is None: msg = (_('initialize_connection: Failed to get attributes' - ' for volume %s') % volume_name) + ' for volume %s.') % volume_name) LOG.error(msg) raise exception.VolumeDriverException(message=msg) @@ -385,10 +385,10 @@ class StorwizeSVCDriver(san.SanDriver): IO_group = volume_attributes['IO_group_id'] except KeyError as e: LOG.error(_LE('Did not find expected column name in ' - 'lsvdisk: %s'), e) + 'lsvdisk: %s.'), e) raise exception.VolumeBackendAPIException( data=_('initialize_connection: Missing volume attribute for ' - 'volume %s') % volume_name) + 'volume %s.') % volume_name) try: # Get preferred node and other nodes in I/O group @@ -404,7 +404,7 @@ class StorwizeSVCDriver(san.SanDriver): if not len(io_group_nodes): msg = (_('initialize_connection: No node found in ' - 'I/O group %(gid)s for volume %(vol)s') % + 'I/O group %(gid)s for volume %(vol)s.') % {'gid': IO_group, 'vol': volume_name}) LOG.error(msg) raise exception.VolumeBackendAPIException(data=msg) @@ -413,7 +413,7 @@ class StorwizeSVCDriver(san.SanDriver): # Get 1st node in I/O group preferred_node_entry = io_group_nodes[0] LOG.warning(_LW('initialize_connection: Did not find a ' - 'preferred node for volume %s'), volume_name) + 'preferred node for volume %s.'), volume_name) properties = {} properties['target_discovered'] = False @@ -764,7 +764,7 @@ class StorwizeSVCDriver(san.SanDriver): return replica_status def _check_volume_copy_ops(self): - LOG.debug("enter: update volume copy status") + LOG.debug("Enter: update volume copy status.") ctxt = context.get_admin_context() copy_items = self._vdiskcopyops.items() for vol_id, copy_ops in copy_items: @@ -793,7 +793,7 @@ class StorwizeSVCDriver(san.SanDriver): self._helpers.rm_vdisk_copy(volume['name'], copy_op[0]) self._rm_vdisk_copy_op(ctxt, volume, copy_op[0], copy_op[1]) - LOG.debug("exit: update volume copy status") + LOG.debug("Exit: update volume copy status.") def migrate_volume(self, ctxt, volume, host): """Migrate directly if source and dest are managed by same storage. @@ -1014,7 +1014,7 @@ class StorwizeSVCDriver(san.SanDriver): IBM Storwize will create CG until cg-snapshot creation, db will maintain the volumes and CG relationship. """ - LOG.debug("Creating consistency group") + LOG.debug("Creating consistency group.") model_update = {'status': 'available'} return model_update @@ -1023,7 +1023,7 @@ class StorwizeSVCDriver(san.SanDriver): IBM Storwize will delete the volumes of the CG. """ - LOG.debug("deleting consistency group") + LOG.debug("Deleting consistency group.") model_update = {} model_update['status'] = 'deleted' volumes = self.db.volume_get_all_by_group(context, group['id']) @@ -1078,7 +1078,7 @@ class StorwizeSVCDriver(san.SanDriver): def _update_volume_stats(self): """Retrieve stats info from volume group.""" - LOG.debug("Updating volume stats") + LOG.debug("Updating volume stats.") data = {} data['vendor_name'] = 'IBM' @@ -1099,9 +1099,9 @@ class StorwizeSVCDriver(san.SanDriver): attributes = self._helpers.get_pool_attrs(pool) if not attributes: - LOG.error(_LE('Could not get pool data from the storage')) + LOG.error(_LE('Could not get pool data from the storage.')) exception_message = (_('_update_volume_stats: ' - 'Could not get storage pool data')) + 'Could not get storage pool data.')) raise exception.VolumeBackendAPIException(data=exception_message) data['total_capacity_gb'] = (float(attributes['capacity']) / diff --git a/cinder/volume/drivers/ibm/storwize_svc/helpers.py b/cinder/volume/drivers/ibm/storwize_svc/helpers.py index f684f4dda..b9ee07109 100644 --- a/cinder/volume/drivers/ibm/storwize_svc/helpers.py +++ b/cinder/volume/drivers/ibm/storwize_svc/helpers.py @@ -57,7 +57,7 @@ class StorwizeHelpers(object): @staticmethod def handle_keyerror(cmd, out): - msg = (_('Could not find key in output of command %(cmd)s: %(out)s') + msg = (_('Could not find key in output of command %(cmd)s: %(out)s.') % {'out': out, 'cmd': cmd}) raise exception.VolumeBackendAPIException(data=msg) @@ -100,7 +100,7 @@ class StorwizeHelpers(object): self.handle_keyerror('lsiogrp', iogrp) except ValueError: msg = (_('Expected integer for node_count, ' - 'svcinfo lsiogrp returned: %(node)s') % + 'svcinfo lsiogrp returned: %(node)s.') % {'node': iogrp['node_count']}) LOG.error(msg) raise exception.VolumeBackendAPIException(data=msg) @@ -156,7 +156,7 @@ class StorwizeHelpers(object): if 'active' == s: wwpns.add(i) node['WWPN'] = list(wwpns) - LOG.info(_LI('WWPN on node %(node)s: %(wwpn)s'), + LOG.info(_LI('WWPN on node %(node)s: %(wwpn)s.'), {'node': node['id'], 'wwpn': node['WWPN']}) def add_chap_secret_to_host(self, host_name): @@ -178,7 +178,7 @@ class StorwizeHelpers(object): except KeyError: self.handle_keyerror('lsiscsiauth', host_data) if not host_found: - msg = _('Failed to find host %s') % host_name + msg = _('Failed to find host %s.') % host_name raise exception.VolumeBackendAPIException(data=msg) return None @@ -192,7 +192,7 @@ class StorwizeHelpers(object): def get_host_from_connector(self, connector): """Return the Storwize host described by the connector.""" - LOG.debug('enter: get_host_from_connector: %s', connector) + LOG.debug('Enter: get_host_from_connector: %s.', connector) # If we have FC information, we have a faster lookup option host_name = None @@ -210,7 +210,7 @@ class StorwizeHelpers(object): self.handle_keyerror('lsfabric', wwpn_info) if host_name: - LOG.debug('leave: get_host_from_connector: host %s', host_name) + LOG.debug('Leave: get_host_from_connector: host %s.', host_name) return host_name # That didn't work, so try exhaustive search @@ -234,7 +234,7 @@ class StorwizeHelpers(object): if found: break - LOG.debug('leave: get_host_from_connector: host %s', host_name) + LOG.debug('Leave: get_host_from_connector: host %s.', host_name) return host_name def create_host(self, connector): @@ -245,13 +245,13 @@ class StorwizeHelpers(object): host name (at most 55 characters), plus a random 8-character suffix to avoid collisions. The total length should be at most 63 characters. """ - LOG.debug('enter: create_host: host %s', connector['host']) + LOG.debug('Enter: create_host: host %s.', connector['host']) # Before we start, make sure host name is a string and that we have at # least one port. host_name = connector['host'] if not isinstance(host_name, six.string_types): - msg = _('create_host: Host name is not unicode or string') + msg = _('create_host: Host name is not unicode or string.') LOG.error(msg) raise exception.VolumeDriverException(message=msg) @@ -292,7 +292,7 @@ class StorwizeHelpers(object): for port in ports: self.ssh.addhostport(host_name, port[0], port[1]) - LOG.debug('leave: create_host: host %(host)s - %(host_name)s', + LOG.debug('Leave: create_host: host %(host)s - %(host_name)s.', {'host': connector['host'], 'host_name': host_name}) return host_name @@ -302,8 +302,8 @@ class StorwizeHelpers(object): def map_vol_to_host(self, volume_name, host_name, multihostmap): """Create a mapping between a volume to a host.""" - LOG.debug('enter: map_vol_to_host: volume %(volume_name)s to ' - 'host %(host_name)s', + LOG.debug('Enter: map_vol_to_host: volume %(volume_name)s to ' + 'host %(host_name)s.', {'volume_name': volume_name, 'host_name': host_name}) # Check if this volume is already mapped to this host @@ -328,8 +328,8 @@ class StorwizeHelpers(object): self.ssh.mkvdiskhostmap(host_name, volume_name, result_lun, multihostmap) - LOG.debug('leave: map_vol_to_host: LUN %(result_lun)s, volume ' - '%(volume_name)s, host %(host_name)s', + LOG.debug('Leave: map_vol_to_host: LUN %(result_lun)s, volume ' + '%(volume_name)s, host %(host_name)s.', {'result_lun': result_lun, 'volume_name': volume_name, 'host_name': host_name}) @@ -338,8 +338,8 @@ class StorwizeHelpers(object): def unmap_vol_from_host(self, volume_name, host_name): """Unmap the volume and delete the host if it has no more mappings.""" - LOG.debug('enter: unmap_vol_from_host: volume %(volume_name)s from ' - 'host %(host_name)s', + LOG.debug('Enter: unmap_vol_from_host: volume %(volume_name)s from ' + 'host %(host_name)s.', {'volume_name': volume_name, 'host_name': host_name}) # Check if the mapping exists @@ -375,8 +375,8 @@ class StorwizeHelpers(object): if not len(resp): self.delete_host(host_name) - LOG.debug('leave: unmap_vol_from_host: volume %(volume_name)s from ' - 'host %(host_name)s', + LOG.debug('Leave: unmap_vol_from_host: volume %(volume_name)s from ' + 'host %(host_name)s.', {'volume_name': volume_name, 'host_name': host_name}) @staticmethod @@ -409,39 +409,39 @@ class StorwizeHelpers(object): if not (opts['rsize'] >= -1 and opts['rsize'] <= 100): raise exception.InvalidInput( reason=_('Illegal value specified for storwize_svc_vol_rsize: ' - 'set to either a percentage (0-100) or -1')) + 'set to either a percentage (0-100) or -1.')) # Check that warning is either -1 or between 0 and 100 if not (opts['warning'] >= -1 and opts['warning'] <= 100): raise exception.InvalidInput( reason=_('Illegal value specified for ' 'storwize_svc_vol_warning: ' - 'set to a percentage (0-100)')) + 'set to a percentage (0-100).')) # Check that grainsize is 32/64/128/256 if opts['grainsize'] not in [32, 64, 128, 256]: raise exception.InvalidInput( reason=_('Illegal value specified for ' 'storwize_svc_vol_grainsize: set to either ' - '32, 64, 128, or 256')) + '32, 64, 128, or 256.')) # Check that compression is supported if opts['compression'] and not state['compression_enabled']: raise exception.InvalidInput( - reason=_('System does not support compression')) + reason=_('System does not support compression.')) # Check that rsize is set if compression is set if opts['compression'] and opts['rsize'] == -1: raise exception.InvalidInput( reason=_('If compression is set to True, rsize must ' - 'also be set (not equal to -1)')) + 'also be set (not equal to -1).')) # Check that the requested protocol is enabled if opts['protocol'] not in state['enabled_protocols']: raise exception.InvalidInput( reason=_('Illegal value %(prot)s specified for ' 'storwize_svc_connection_protocol: ' - 'valid values are %(enabled)s') + 'valid values are %(enabled)s.') % {'prot': opts['protocol'], 'enabled': ','.join(state['enabled_protocols'])}) @@ -449,7 +449,7 @@ class StorwizeHelpers(object): avail_grps = ''.join(str(e) for e in state['available_iogrps']) raise exception.InvalidInput( reason=_('I/O group %(iogrp)d is not valid; available ' - 'I/O groups are %(avail)s') + 'I/O groups are %(avail)s.') % {'iogrp': opts['iogrp'], 'avail': avail_grps}) @@ -557,14 +557,14 @@ class StorwizeHelpers(object): testValue = False LOG.debug('Helper.' '_wait_for_condition: %(method_name)s ' - 'execution failed for %(exception)s', + 'execution failed for %(exception)s.', {'method_name': testmethod.__name__, 'exception': ex.message}) if testValue: raise loopingcall.LoopingCallDone() if int(time.time()) - start_time > timeout: - msg = (_('CommandLineHelper._wait_for_condition: %s timeout') + msg = (_('CommandLineHelper._wait_for_condition: %s timeout.') % testmethod.__name__) LOG.error(msg) raise exception.VolumeBackendAPIException(data=msg) @@ -627,10 +627,10 @@ class StorwizeHelpers(object): return params def create_vdisk(self, name, size, units, pool, opts): - LOG.debug('enter: create_vdisk: vdisk %s ', name) + LOG.debug('Enter: create_vdisk: vdisk %s.', name) params = self._get_vdisk_create_params(opts) self.ssh.mkvdisk(name, size, units, pool, opts, params) - LOG.debug('leave: _create_vdisk: volume %s ', name) + LOG.debug('Leave: _create_vdisk: volume %s.', name) def get_vdisk_attributes(self, vdisk): attrs = self.ssh.lsvdisk(vdisk) @@ -692,8 +692,8 @@ class StorwizeHelpers(object): elif mapping_attrs['status'] == 'stopped': self.ssh.prestartfcmap(fc_map_id) elif mapping_attrs['status'] != 'preparing': - msg = (_('Unexecpted mapping status %(status)s for mapping' - '%(id)s. Attributes: %(attr)s') + msg = (_('Unexecpted mapping status %(status)s for mapping ' + '%(id)s. Attributes: %(attr)s.') % {'status': mapping_attrs['status'], 'id': fc_map_id, 'attr': mapping_attrs}) @@ -747,7 +747,7 @@ class StorwizeHelpers(object): # Release cg self.delete_fc_consistgrp(fc_consistgrp) LOG.error(_LE("Failed to create CGSnapshot. " - "Exception: %s"), err) + "Exception: %s."), err) return cgsnapshot, snapshots @@ -763,7 +763,7 @@ class StorwizeHelpers(object): snapshot['status'] = 'error_deleting' cgsnapshot['status'] = 'error_deleting' LOG.error(_LE("Failed to delete the snapshot %(snap)s of " - "CGSnapshot. Exception: %(exception)s"), + "CGSnapshot. Exception: %(exception)s."), {'snap': snapshot['name'], 'exception': err}) return cgsnapshot, snapshots @@ -783,7 +783,7 @@ class StorwizeHelpers(object): self.ssh.prestartfcconsistgrp(fc_consistgrp) elif mapping_attrs['status'] != 'preparing': msg = (_('Unexpected mapping status %(status)s for mapping' - '%(id)s. Attributes: %(attr)s') % + '%(id)s. Attributes: %(attr)s.') % {'status': mapping_attrs['status'], 'id': fc_consistgrp, 'attr': mapping_attrs}) @@ -794,31 +794,31 @@ class StorwizeHelpers(object): def run_flashcopy(self, source, target, timeout, full_copy=True): """Create a FlashCopy mapping from the source to the target.""" - LOG.debug('enter: run_flashcopy: execute FlashCopy from source ' - '%(source)s to target %(target)s', + LOG.debug('Enter: run_flashcopy: execute FlashCopy from source ' + '%(source)s to target %(target)s.', {'source': source, 'target': target}) fc_map_id = self.ssh.mkfcmap(source, target, full_copy) self._prepare_fc_map(fc_map_id, timeout) self.ssh.startfcmap(fc_map_id) - LOG.debug('leave: run_flashcopy: FlashCopy started from ' - '%(source)s to %(target)s', + LOG.debug('Leave: run_flashcopy: FlashCopy started from ' + '%(source)s to %(target)s.', {'source': source, 'target': target}) def create_flashcopy_to_consistgrp(self, source, target, consistgrp, config, opts, full_copy=False, pool=None): """Create a FlashCopy mapping and add to consistent group.""" - LOG.debug('enter: create_flashcopy_to_consistgrp: create FlashCopy' + LOG.debug('Enter: create_flashcopy_to_consistgrp: create FlashCopy' ' from source %(source)s to target %(target)s' - 'Then add the flashcopy to %(cg)s', + 'Then add the flashcopy to %(cg)s.', {'source': source, 'target': target, 'cg': consistgrp}) src_attrs = self.get_vdisk_attributes(source) if src_attrs is None: msg = (_('create_copy: Source vdisk %(src)s ' - 'does not exist') % {'src': source}) + 'does not exist.') % {'src': source}) LOG.error(msg) raise exception.VolumeDriverException(message=msg) @@ -830,8 +830,8 @@ class StorwizeHelpers(object): self.ssh.mkfcmap(source, target, full_copy, consistgrp) - LOG.debug('leave: create_flashcopy_to_consistgrp: ' - 'FlashCopy started from %(source)s to %(target)s', + LOG.debug('Leave: create_flashcopy_to_consistgrp: ' + 'FlashCopy started from %(source)s to %(target)s.', {'source': source, 'target': target}) def _get_vdisk_fc_mappings(self, vdisk): @@ -856,7 +856,7 @@ class StorwizeHelpers(object): def _check_vdisk_fc_mappings(self, name, allow_snaps=True): """FlashCopy mapping check helper.""" - LOG.debug('Loopcall: _check_vdisk_fc_mappings(), vdisk %s', name) + LOG.debug('Loopcall: _check_vdisk_fc_mappings(), vdisk %s.', name) mapping_ids = self._get_vdisk_fc_mappings(name) wait_for_copy = False for map_id in mapping_ids: @@ -880,7 +880,7 @@ class StorwizeHelpers(object): # A snapshot if target != name: msg = (_('Vdisk %(name)s not involved in ' - 'mapping %(src)s -> %(tgt)s') % + 'mapping %(src)s -> %(tgt)s.') % {'name': name, 'src': source, 'tgt': target}) LOG.error(msg) raise exception.VolumeDriverException(message=msg) @@ -915,7 +915,7 @@ class StorwizeHelpers(object): # before it finishes. Don't set the sleep interval shorter # than the heartbeat. Otherwise volume service heartbeat # will not be serviced. - LOG.debug('Calling _ensure_vdisk_no_fc_mappings: vdisk %s', + LOG.debug('Calling _ensure_vdisk_no_fc_mappings: vdisk %s.', name) ret = timer.start(interval=self.check_fcmapping_interval).wait() timer.stop() @@ -923,24 +923,24 @@ class StorwizeHelpers(object): def delete_vdisk(self, vdisk, force): """Ensures that vdisk is not part of FC mapping and deletes it.""" - LOG.debug('enter: delete_vdisk: vdisk %s', vdisk) + LOG.debug('Enter: delete_vdisk: vdisk %s.', vdisk) if not self.is_vdisk_defined(vdisk): LOG.info(_LI('Tried to delete non-existent vdisk %s.'), vdisk) return self.ensure_vdisk_no_fc_mappings(vdisk) self.ssh.rmvdisk(vdisk, force=force) - LOG.debug('leave: delete_vdisk: vdisk %s', vdisk) + LOG.debug('Leave: delete_vdisk: vdisk %s.', vdisk) def create_copy(self, src, tgt, src_id, config, opts, full_copy, pool=None): """Create a new snapshot using FlashCopy.""" - LOG.debug('enter: create_copy: snapshot %(src)s to %(tgt)s', + LOG.debug('Enter: create_copy: snapshot %(src)s to %(tgt)s.', {'tgt': tgt, 'src': src}) src_attrs = self.get_vdisk_attributes(src) if src_attrs is None: msg = (_('create_copy: Source vdisk %(src)s (%(src_id)s) ' - 'does not exist') % {'src': src, 'src_id': src_id}) + 'does not exist.') % {'src': src, 'src_id': src_id}) LOG.error(msg) raise exception.VolumeDriverException(message=msg) @@ -956,8 +956,8 @@ class StorwizeHelpers(object): with excutils.save_and_reraise_exception(): self.delete_vdisk(tgt, True) - LOG.debug('leave: _create_copy: snapshot %(tgt)s from ' - 'vdisk %(src)s', + LOG.debug('Leave: _create_copy: snapshot %(tgt)s from ' + 'vdisk %(src)s.', {'tgt': tgt, 'src': src}) def extend_vdisk(self, vdisk, amount): @@ -1059,7 +1059,7 @@ class StorwizeHelpers(object): def change_vdisk_iogrp(self, vdisk, state, iogrp): if state['code_level'] < (6, 4, 0, 0): LOG.debug('Ignore change IO group as storage code level is ' - '%(code_level)s, below the required 6.4.0.0', + '%(code_level)s, below the required 6.4.0.0.', {'code_level': state['code_level']}) else: self.ssh.movevdisk(vdisk, str(iogrp[0])) diff --git a/cinder/volume/drivers/ibm/storwize_svc/replication.py b/cinder/volume/drivers/ibm/storwize_svc/replication.py index c17590f91..c49ea388e 100644 --- a/cinder/volume/drivers/ibm/storwize_svc/replication.py +++ b/cinder/volume/drivers/ibm/storwize_svc/replication.py @@ -107,7 +107,7 @@ class StorwizeSVCReplicationStretchedCluster(StorwizeSVCReplication): True, pool=dest_pool) else: - msg = (_('Unable to create replica clone for volume %s'), vdisk) + msg = (_('Unable to create replica clone for volume %s.'), vdisk) raise exception.VolumeDriverException(message=msg) def promote_replica(self, volume): @@ -146,7 +146,7 @@ class StorwizeSVCReplicationStretchedCluster(StorwizeSVCReplication): status = 'active' extended1 = (_('Primary copy status: %(status)s' - ' and synchronized: %(sync)s') % + ' and synchronized: %(sync)s.') % {'status': primary['status'], 'sync': primary['sync']}) @@ -176,7 +176,7 @@ class StorwizeSVCReplicationStretchedCluster(StorwizeSVCReplication): extended2 = (_('Secondary copy status: %(status)s' ' and synchronized: %(sync)s,' - ' sync progress is: %(progress)s%%') % + ' sync progress is: %(progress)s%%.') % {'status': secondary['status'], 'sync': secondary['sync'], 'progress': secondary['sync_progress']}) diff --git a/cinder/volume/drivers/ibm/storwize_svc/ssh.py b/cinder/volume/drivers/ibm/storwize_svc/ssh.py index 15c6e384b..d707fbb0b 100644 --- a/cinder/volume/drivers/ibm/storwize_svc/ssh.py +++ b/cinder/volume/drivers/ibm/storwize_svc/ssh.py @@ -36,7 +36,7 @@ class StorwizeSSH(object): return self._ssh(ssh_cmd) except processutils.ProcessExecutionError as e: msg = (_('CLI Exception output:\n command: %(cmd)s\n ' - 'stdout: %(out)s\n stderr: %(err)s') % + 'stdout: %(out)s\n stderr: %(err)s.') % {'cmd': ssh_cmd, 'out': e.stdout, 'err': e.stderr}) @@ -54,7 +54,7 @@ class StorwizeSSH(object): out, err = self._run_ssh(ssh_cmd) if len(out.strip()) != 0: msg = (_('Expected no output from CLI command %(cmd)s, ' - 'got %(out)s') % {'cmd': ' '.join(ssh_cmd), 'out': out}) + 'got %(out)s.') % {'cmd': ' '.join(ssh_cmd), 'out': out}) LOG.error(msg) raise exception.VolumeBackendAPIException(data=msg) @@ -66,7 +66,7 @@ class StorwizeSSH(object): return match_obj.group(1) except (AttributeError, IndexError): msg = (_('Failed to parse CLI output:\n command: %(cmd)s\n ' - 'stdout: %(out)s\n stderr: %(err)s') % + 'stdout: %(out)s\n stderr: %(err)s.') % {'cmd': ssh_cmd, 'out': out, 'err': err}) @@ -162,7 +162,7 @@ class StorwizeSSH(object): return if not err: msg = (_('Did not find success message nor error for %(fun)s: ' - '%(out)s') % {'out': out, 'fun': ssh_cmd}) + '%(out)s.') % {'out': out, 'fun': ssh_cmd}) raise exception.VolumeBackendAPIException(data=msg) if err.startswith('CMMVC6071E'): if not multihostmap: @@ -215,7 +215,7 @@ class StorwizeSSH(object): if err.startswith('CMMVC5754E'): return None msg = (_('CLI Exception output:\n command: %(cmd)s\n ' - 'stdout: %(out)s\n stderr: %(err)s') % + 'stdout: %(out)s\n stderr: %(err)s.') % {'cmd': ssh_cmd, 'out': out, 'err': err}) @@ -254,7 +254,7 @@ class StorwizeSSH(object): out, err = self._ssh(ssh_cmd, check_exit_code=False) if 'successfully created' not in out: msg = (_('CLI Exception output:\n command: %(cmd)s\n ' - 'stdout: %(out)s\n stderr: %(err)s') % + 'stdout: %(out)s\n stderr: %(err)s.') % {'cmd': ssh_cmd, 'out': out, 'err': err}) @@ -266,7 +266,7 @@ class StorwizeSSH(object): fc_map_id = match_obj.group(1) except (AttributeError, IndexError): msg = (_('Failed to parse CLI output:\n command: %(cmd)s\n ' - 'stdout: %(out)s\n stderr: %(err)s') % + 'stdout: %(out)s\n stderr: %(err)s.') % {'cmd': ssh_cmd, 'out': out, 'err': err}) @@ -395,8 +395,9 @@ class CLIResponse(object): try: return self.result[key] except KeyError: - msg = (_('Did not find expected key %(key)s in %(fun)s: %(raw)s') % - {'key': key, 'fun': self.ssh_cmd, 'raw': self.raw}) + msg = (_('Did not find the expected key %(key)s in %(fun)s: ' + '%(raw)s.') % {'key': key, 'fun': self.ssh_cmd, + 'raw': self.raw}) raise exception.VolumeBackendAPIException(data=msg) def __iter__(self): @@ -431,7 +432,7 @@ class CLIResponse(object): cur = dict() if len(hds) != len(row): msg = (_('Unexpected CLI response: header/row mismatch. ' - 'header: %(header)s, row: %(row)s') + 'header: %(header)s, row: %(row)s.') % {'header': hds, 'row': row}) raise exception.VolumeBackendAPIException(data=msg) -- 2.45.2