Merge "zfssaiscsi driver log messges need cleaned up"

This commit is contained in:
Jenkins 2016-09-06 10:53:44 +00:00 committed by Gerrit Code Review
commit 41d4e5b55f

View File

@ -182,13 +182,12 @@ class ZFSSAISCSIDriver(driver.ISCSIDriver):
for initiator_group in initiator_config:
zfssa_initiator_group = initiator_group
for zfssa_initiator in initiator_config[zfssa_initiator_group]:
self.zfssa.create_initiator(zfssa_initiator['iqn'],
zfssa_initiator_group + '-' +
zfssa_initiator['iqn'],
chapuser=
zfssa_initiator['user'],
chapsecret=
zfssa_initiator['password'])
self.zfssa.create_initiator(
zfssa_initiator['iqn'],
zfssa_initiator_group + '-' + zfssa_initiator['iqn'],
chapuser=zfssa_initiator['user'],
chapsecret=zfssa_initiator['password'])
if (zfssa_initiator_group != 'default'):
self.zfssa.add_to_initiatorgroup(
zfssa_initiator['iqn'],
@ -221,8 +220,9 @@ class ZFSSAISCSIDriver(driver.ISCSIDriver):
for initiator in lcfg.zfssa_initiator.split(','):
initiator = initiator.strip()
self.zfssa.create_initiator(
initiator, lcfg.zfssa_initiator_group + '-' +
initiator, chapuser=lcfg.zfssa_initiator_user,
initiator,
lcfg.zfssa_initiator_group + '-' + initiator,
chapuser=lcfg.zfssa_initiator_user,
chapsecret=lcfg.zfssa_initiator_password)
self.zfssa.add_to_initiatorgroup(
initiator, lcfg.zfssa_initiator_group)
@ -244,8 +244,8 @@ class ZFSSAISCSIDriver(driver.ISCSIDriver):
self.zfssa.add_to_targetgroup(iqn, lcfg.zfssa_target_group)
if lcfg.zfssa_manage_policy not in ("loose", "strict"):
err_msg = (_("zfssa_manage_policy property needs to be set to"
" 'strict' or 'loose'. Current value is: %s.") %
err_msg = (_("zfssa_manage_policy property needs to be set to "
"'strict' or 'loose'. Current value is: %s.") %
lcfg.zfssa_manage_policy)
LOG.error(err_msg)
raise exception.InvalidInput(reason=err_msg)
@ -407,7 +407,7 @@ class ZFSSAISCSIDriver(driver.ISCSIDriver):
if not self._verify_clone_size(snapshot, volume['size'] * units.Gi):
exception_msg = (_('Error verifying clone size on '
'Volume clone: %(clone)s '
'Size: %(size)d on'
'Size: %(size)d on '
'Snapshot: %(snapshot)s')
% {'clone': volume['name'],
'size': volume['size'],
@ -502,8 +502,8 @@ class ZFSSAISCSIDriver(driver.ISCSIDriver):
try:
self.create_volume_from_snapshot(volume, zfssa_snapshot)
except exception.VolumeBackendAPIException:
LOG.error(_LE('Clone Volume:'
'%(volume)s failed from source volume:'
LOG.error(_LE('Clone Volume: '
'%(volume)s failed from source volume: '
'%(src_vref)s'),
{'volume': volume['name'],
'src_vref': src_vref['name']})
@ -609,7 +609,7 @@ class ZFSSAISCSIDriver(driver.ISCSIDriver):
cachevol_props.update(cachevol_meta)
cache_vol, cache_snap = None, None
updated_at = six.text_type(img_meta['updated_at'].isoformat())
LOG.debug('Verifying cache volume %s:', cachevol_name)
LOG.debug('Verifying cache volume: %s', cachevol_name)
try:
cache_vol = self.zfssa.get_lun(lcfg.zfssa_pool,
@ -634,7 +634,7 @@ class ZFSSAISCSIDriver(driver.ISCSIDriver):
specs,
cachevol_props)
except exception.SnapshotNotFound:
exception_msg = (_('Cache volume %(cache_vol)s'
exception_msg = (_('Cache volume %(cache_vol)s '
'does not have snapshot %(cache_snap)s.'),
{'cache_vol': cachevol_name,
'cache_snap': cachesnap_name})
@ -934,7 +934,8 @@ class ZFSSAISCSIDriver(driver.ISCSIDriver):
'tgt_zfssa': self.tgt_zfssa,
'tgt_pool': tgt_pool,
'tgt_project': tgt_project,
'volume': volume, 'tgt_asn': tgt_asn,
'volume': volume,
'tgt_asn': tgt_asn,
'src_zfssa': self.zfssa,
'src_asn': src_asn,
'src_pool': src_pool,
@ -1016,7 +1017,7 @@ class ZFSSAISCSIDriver(driver.ISCSIDriver):
lcfg.zfssa_cache_project,
cache['share'])
except exception.VolumeBackendAPIException:
LOG.warning(_LW("Volume %s exists but can't be deleted"),
LOG.warning(_LW("Volume %s exists but can't be deleted."),
cache['share'])
def manage_existing(self, volume, existing_ref):
@ -1068,8 +1069,8 @@ class ZFSSAISCSIDriver(driver.ISCSIDriver):
schema={"custom:cinder_managed": False})
except exception.VolumeBackendAPIException:
with excutils.save_and_reraise_exception():
LOG.error(_LE("Failed to rename volume %(existing)s to"
" %(new)s. Volume unmanage failed."),
LOG.error(_LE("Failed to rename volume %(existing)s to "
"%(new)s. Volume unmanage failed."),
{'existing': volume['name'],
'new': new_name})
return None
@ -1085,8 +1086,8 @@ class ZFSSAISCSIDriver(driver.ISCSIDriver):
err_msg = (_("Unknown if the volume: %s to be managed is "
"already being managed by Cinder. Aborting manage "
"volume. Please add 'cinder_managed' custom schema "
"property to the volume and set its value to False."
" Alternatively, set the value of cinder config "
"property to the volume and set its value to False. "
"Alternatively, set the value of cinder config "
"policy 'zfssa_manage_policy' to 'loose' to "
"remove this restriction.") % vol_name)
LOG.error(err_msg)