]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Mask passwords with iscsiadm commands
authorWalter A. Boring IV <walter.boring@hp.com>
Thu, 16 Apr 2015 17:44:10 +0000 (10:44 -0700)
committerWalter A. Boring IV <walter.boring@hp.com>
Thu, 16 Apr 2015 17:44:48 +0000 (10:44 -0700)
This patch adds the fix that exists in the nova
libvirt volume code to use oslo_utils strutils
to mask passwords that might show up in debug log
messages.

Change-Id: I5c321d6b2627f186ff3dfe64ee7ad71f27a95cf0
Closes-Bug: 1445137

cinder/brick/initiator/connector.py

index f18bf5fc20309ad46bc0a3b765c36d5ab8fcf5a2..449f83e9e1eaefb0d4917c0c2fc6788407683f18 100644 (file)
@@ -23,6 +23,7 @@ import time
 from oslo_concurrency import lockutils
 from oslo_concurrency import processutils as putils
 from oslo_log import log as logging
+from oslo_utils import strutils
 import six
 
 from cinder.brick import exception
@@ -451,8 +452,10 @@ class ISCSIConnector(InitiatorConnector):
                                    *iscsi_command, run_as_root=True,
                                    root_helper=self._root_helper,
                                    check_exit_code=check_exit_code)
-        LOG.debug("iscsiadm %(cmd)s: stdout=%(out)s stderr=%(err)s",
-                  {'cmd': iscsi_command, 'out': out, 'err': err})
+        msg = ("iscsiadm %(cmd)s: stdout=%(out)s stderr=%(err)s",
+               {'cmd': iscsi_command, 'out': out, 'err': err})
+        LOG.debug(strutils.mask_password(msg))
+
         return (out, err)
 
     def _iscsiadm_update(self, connection_properties, property_key,