HDS HNAS driver logs every command that is sent to HNAS. Some
commands need the HNAS password, so the driver ends up logging
this password as plain text. This patch changes these commands
syntax so that oslo_utils.strutils.mask_password can successfully
mask this password.
Change-Id: I720701d8ee2b944ad498917f668160894f1f07cc
Closes-Bug: #
1491524
if self.drv_configs['ssh_enabled'] != 'True':
# Direct connection via ssc
- args = (cmd, '-u', user, '-p', pw, ip0) + args
+ args = (cmd, '--user', user, '--password', pw, ip0) + args
try:
out, err = utils.execute(*args, **kwargs)
try:
val = root.findtext(element)
- LOG.info(_LI("%(element)s: %(val)s"), {'element': element, 'val': val})
+ LOG.info(_LI("%(element)s: %(val)s"),
+ {'element': element,
+ 'val': val if element != 'password' else '***'})
if val:
return val.strip()
if check:
try:
val = root.findtext(element)
- LOG.info(_LI("%(element)s: %(val)s"), {'element': element, 'val': val})
+ LOG.info(_LI("%(element)s: %(val)s"),
+ {'element': element,
+ 'val': val if element != 'password' else '***'})
if val:
return val.strip()
if check: