Merge "Hash password displays in debug log"
This commit is contained in:
commit
d4395bb538
@ -27,7 +27,6 @@ from cinder.tests.unit import fake_snapshot
|
||||
from cinder.tests.unit.fake_volume import fake_volume_obj
|
||||
from cinder.volume.drivers.dell_emc import xtremio
|
||||
|
||||
|
||||
typ2id = {'volumes': 'vol-id',
|
||||
'snapshots': 'vol-id',
|
||||
'initiators': 'initiator-id',
|
||||
@ -672,6 +671,14 @@ class XtremIODriverISCSITestCase(BaseXtremIODriverTestCase):
|
||||
self.driver.initialize_connection(self.data.test_volume2,
|
||||
self.data.connector)
|
||||
|
||||
@mock.patch('oslo_utils.strutils.mask_dict_password')
|
||||
def test_initialize_connection_masks_password(self, mask_dict, req):
|
||||
req.side_effect = xms_request
|
||||
self.driver.create_volume(self.data.test_volume)
|
||||
self.driver.initialize_connection(self.data.test_volume,
|
||||
self.data.connector)
|
||||
self.assertTrue(mask_dict.called)
|
||||
|
||||
def test_add_auth(self, req):
|
||||
req.side_effect = xms_request
|
||||
data = {}
|
||||
|
@ -38,6 +38,7 @@ import string
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import strutils
|
||||
from oslo_utils import units
|
||||
import six
|
||||
|
||||
@ -1015,7 +1016,8 @@ class XtremIOISCSIDriver(XtremIOVolumeDriver, driver.ISCSIDriver):
|
||||
properties['discovery_auth_method'] = 'CHAP'
|
||||
properties['discovery_auth_username'] = 'chap_user'
|
||||
properties['discovery_auth_password'] = discovery_passwd
|
||||
LOG.debug('init conn params:\n%s', properties)
|
||||
LOG.debug('init conn params:\n%s',
|
||||
strutils.mask_dict_password(properties))
|
||||
return {
|
||||
'driver_volume_type': 'iscsi',
|
||||
'data': properties
|
||||
|
Loading…
Reference in New Issue
Block a user