Merge "Deprecate nas_ip and change this to nas_host"

This commit is contained in:
Jenkins
2016-04-20 17:09:59 +00:00
committed by Gerrit Code Review
9 changed files with 24 additions and 16 deletions

View File

@@ -37,11 +37,12 @@ from cinder.volume import driver
LOG = logging.getLogger(__name__)
nas_opts = [
# TODO(eharney): deprecate nas_ip and change this to nas_host
cfg.StrOpt('nas_ip',
cfg.StrOpt('nas_host',
default='',
help='IP address or Hostname of NAS system.'),
help='IP address or Hostname of NAS system.',
deprecated_name='nas_ip'),
cfg.StrOpt('nas_login',
default='admin',
help='User name to connect to NAS system.'),
@@ -435,19 +436,19 @@ class RemoteFSDriver(driver.LocalVD, driver.TransferVD, driver.BaseVD):
def _load_shares_config(self, share_file=None):
self.shares = {}
if all((self.configuration.nas_ip,
if all((self.configuration.nas_host,
self.configuration.nas_share_path)):
LOG.debug('Using nas_ip and nas_share_path configuration.')
LOG.debug('Using nas_host and nas_share_path configuration.')
nas_ip = self.configuration.nas_ip
nas_host = self.configuration.nas_host
nas_share_path = self.configuration.nas_share_path
share_address = '%s:%s' % (nas_ip, nas_share_path)
share_address = '%s:%s' % (nas_host, nas_share_path)
if not re.match(self.SHARE_FORMAT_REGEX, share_address):
msg = (_("Share %s ignored due to invalid format. Must "
"be of form address:/export. Please check the "
"nas_ip and nas_share_path settings."),
"nas_host and nas_share_path settings."),
share_address)
raise exception.InvalidConfigurationValue(msg)