diff options
author | Zuul <zuul@review.openstack.org> | 2018-05-31 23:10:59 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2018-05-31 23:10:59 +0000 |
commit | 0886574afaa70372804039c245f9d2f2c4f6f339 (patch) | |
tree | 40d4e39231085e1adbfa1b574892260122cef478 | |
parent | e162b562c9b6a681befadec2f77b62f58d93fe08 (diff) | |
parent | c17516f3999447ad0d4ec7ecd8f223f6468b693a (diff) | |
download | nova-0886574afaa70372804039c245f9d2f2c4f6f339.tar.gz |
Merge "Avoid showing password in log" into stable/ocata
-rw-r--r-- | nova/compute/manager.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 30d4d56478..0b68389b8b 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -5031,16 +5031,19 @@ class ComputeManager(manager.Manager): # currently implementing swap_volume, will modify the contents of # new_cinfo when connect_volume is called. This is then saved to # the BDM in swap_volume for future use outside of this flow. - LOG.debug("swap_volume: Calling driver volume swap with " - "connection infos: new: %(new_cinfo)s; " - "old: %(old_cinfo)s", - {'new_cinfo': new_cinfo, 'old_cinfo': old_cinfo}, - instance=instance) + msg = ("swap_volume: Calling driver volume swap with " + "connection infos: new: %(new_cinfo)s; " + "old: %(old_cinfo)s" % + {'new_cinfo': new_cinfo, 'old_cinfo': old_cinfo}) + # Both new and old info might contain password + LOG.debug(strutils.mask_password(msg), instance=instance) + self.driver.swap_volume(context, old_cinfo, new_cinfo, instance, mountpoint, resize_to) - LOG.debug("swap_volume: Driver volume swap returned, new " - "connection_info is now : %(new_cinfo)s", - {'new_cinfo': new_cinfo}) + msg = ("swap_volume: Driver volume swap returned, new " + "connection_info is now : %(new_cinfo)s" % + {'new_cinfo': new_cinfo}) + LOG.debug(strutils.mask_password(msg)) except Exception as ex: failed = True with excutils.save_and_reraise_exception(): |