self.configuration.ssh_max_pool_conn = 5
self.configuration.ssh_conn_timeout = 30
self.configuration.eqlx_pool = 'non-default'
- self.configuration.eqlx_use_chap = True
self.configuration.eqlx_group_name = 'group-0'
self.configuration.eqlx_cli_timeout = 30
self.configuration.eqlx_cli_max_retries = 5
- self.configuration.eqlx_chap_login = 'admin'
- self.configuration.eqlx_chap_password = 'password'
+
+ self.configuration.eqlx_use_chap = False
+ self.configuration.use_chap_auth = True
+ self.configuration.chap_username = 'admin'
+ self.configuration.chap_password = 'password'
+
self._context = context.get_admin_context()
self.driver = eqlx.DellEQLSanISCSIDriver(
configuration=self.configuration)
'provider_location': "%s:3260,1 %s 0" % (self.driver._group_ip,
self.fake_iqn),
'provider_auth': 'CHAP %s %s' % (
- self.configuration.eqlx_chap_login,
- self.configuration.eqlx_chap_password)
+ self.configuration.chap_username,
+ self.configuration.chap_password)
}
def _fake_get_iscsi_properties(self, volume):
self.connector['initiator'],
'authmethod', 'chap',
'username',
- self.configuration.eqlx_chap_login)
+ self.configuration.chap_username)
self.mox.ReplayAll()
iscsi_properties = self.driver.initialize_connection(volume,
self.connector)
LOG = logging.getLogger(__name__)
+
+deprecated_use_chap_auth_opts = [cfg.DeprecatedOpt('eqlx_use_chap')]
+deprecated_chap_username_opts = [cfg.DeprecatedOpt('eqlx_chap_login')]
+deprecated_chap_password_opts = [cfg.DeprecatedOpt('eqlx_chap_password')]
+
volume_opts = [
cfg.IntOpt('num_shell_tries',
default=3,
default='iscsi',
help='SCST target implementation can choose from multiple '
'SCST target drivers.'),
+ cfg.BoolOpt('use_chap_auth',
+ default=False,
+ help='Option to enable/disable CHAP authentication for '
+ 'targets.',
+ deprecated_opts=deprecated_use_chap_auth_opts),
cfg.StrOpt('chap_username',
- default=None,
- help='CHAP username to use for iSCSI Targets'),
+ default='',
+ help='CHAP user name.',
+ deprecated_opts=deprecated_chap_username_opts),
cfg.StrOpt('chap_password',
- default=None,
- help='CHAP password to use for iSCSI Targets'),
+ default='',
+ help='Password for specified CHAP account name.',
+ deprecated_opts=deprecated_chap_password_opts,
+ secret=True),
]
# for backward compatibility
help='Maximum retry count for reconnection. Default is 5.'),
cfg.BoolOpt('eqlx_use_chap',
default=False,
- help='Use CHAP authentication for targets. Defaults to '
- '"False".'),
+ help='Use CHAP authentication for targets. Note that this '
+ 'option is deprecated in favour of "use_chap_auth" as '
+ 'specified in cinder/volume/driver.py and will be '
+ 'removed in next release.'),
cfg.StrOpt('eqlx_chap_login',
default='admin',
- help='Existing CHAP account name. Defaults to "admin".'),
+ help='Existing CHAP account name. Note that this '
+ 'option is deprecated in favour of "chap_username" as '
+ 'specified in cinder/volume/driver.py and will be '
+ 'removed in next release.'),
cfg.StrOpt('eqlx_chap_password',
default='password',
- help='Password for specified CHAP account name. Defaults '
- 'to "password".',
+ help='Password for specified CHAP account name. Note that this '
+ 'option is deprecated in favour of "chap_password" as '
+ 'specified in cinder/volume/driver.py and will be '
+ 'removed in the next release',
secret=True),
cfg.StrOpt('eqlx_pool',
default='default',
In order to use target CHAP authentication (which is disabled by default)
SAN administrator must create a local CHAP user and specify the following
flags for the driver:
- eqlx_use_chap=true
- eqlx_chap_login=<chap_login>
- eqlx_chap_password=<chap_password>
+ use_chap_auth=True
+ chap_login=<chap_login>
+ chap_password=<chap_password>
eqlx_group_name parameter actually represents the CLI prompt message
without '>' ending. E.g. if prompt looks like 'group-0>', then the
eqlx_cli_timeout=<seconds>
"""
- VERSION = "1.0.0"
+ VERSION = "1.1.0"
def __init__(self, *args, **kwargs):
super(DellEQLSanISCSIDriver, self).__init__(*args, **kwargs)
self._group_ip = None
self.sshpool = None
+ if self.configuration.eqlx_use_chap is True:
+ LOG.warning(_LW(
+ 'Configuration options eqlx_use_chap, '
+ 'eqlx_chap_login and eqlx_chap_password are deprecated. Use '
+ 'use_chap_auth, chap_username and chap_password '
+ 'respectively for the same.'))
+
+ self.configuration.use_chap_auth = \
+ self.configuration.eqlx_use_chap
+ self.configuration.chap_username = \
+ self.configuration.eqlx_chap_login
+ self.configuration.chap_password = \
+ self.configuration.eqlx_chap_password
+
def _get_output(self, chan):
out = ''
ending = '%s> ' % self.configuration.eqlx_group_name
lun_id = "%s:%s,1 %s 0" % (self._group_ip, '3260', target_name)
model_update = {}
model_update['provider_location'] = lun_id
- if self.configuration.eqlx_use_chap:
+ if self.configuration.use_chap_auth:
model_update['provider_auth'] = 'CHAP %s %s' % \
- (self.configuration.eqlx_chap_login,
- self.configuration.eqlx_chap_password)
+ (self.configuration.chap_username,
+ self.configuration.chap_password)
return model_update
def _get_space_in_gb(self, val):
try:
cmd = ['volume', 'select', volume['name'], 'access', 'create',
'initiator', connector['initiator']]
- if self.configuration.eqlx_use_chap:
+ if self.configuration.use_chap_auth:
cmd.extend(['authmethod', 'chap', 'username',
- self.configuration.eqlx_chap_login])
+ self.configuration.chap_username])
self._eql_execute(*cmd)
iscsi_properties = self._get_iscsi_properties(volume)
return {