From 64d7923f3665ce5f40572980e1ea65b3c4df02b7 Mon Sep 17 00:00:00 2001 From: "Walter A. Boring IV" Date: Thu, 16 Apr 2015 10:44:10 -0700 Subject: [PATCH] Mask passwords with iscsiadm commands 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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cinder/brick/initiator/connector.py b/cinder/brick/initiator/connector.py index f18bf5fc2..449f83e9e 100644 --- a/cinder/brick/initiator/connector.py +++ b/cinder/brick/initiator/connector.py @@ -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, -- 2.45.2