Deprecate nas_ip and change this to nas_host

This patch fixes a usability/discoverability problem since
the option is named "nas_ip" but isn't just for IPs.

Change-Id: I3383e586219b7f831194805d2d4230ee620c7c14
This commit is contained in:
Yuriy Nesenenko 2016-04-06 15:14:17 +03:00
parent 281ddeb03f
commit 5f5eedec0f
9 changed files with 24 additions and 16 deletions

View File

@ -97,7 +97,7 @@ class CohoDriverTest(test.TestCase):
self.configuration.nfs_sparsed_volumes = True
self.configuration.nfs_mount_point_base = '/opt/stack/cinder/mnt'
self.configuration.nfs_mount_options = None
self.configuration.nas_ip = None
self.configuration.nas_host = None
self.configuration.nas_share_path = None
self.configuration.nas_mount_options = None

View File

@ -92,7 +92,7 @@ class GlusterFsDriverTestCase(test.TestCase):
self.TEST_MNT_POINT_BASE
self._configuration.nas_secure_file_permissions = 'false'
self._configuration.nas_secure_file_operations = 'false'
self._configuration.nas_ip = None
self._configuration.nas_host = None
self._configuration.nas_share_path = None
self._configuration.nas_mount_options = None

View File

@ -253,7 +253,7 @@ class HDSNFSDriverTest(test.TestCase):
self.configuration.nfs_shares_config = self.shares_file.name
self.configuration.nfs_mount_point_base = '/opt/stack/cinder/mnt'
self.configuration.nfs_mount_options = None
self.configuration.nas_ip = None
self.configuration.nas_host = None
self.configuration.nas_share_path = None
self.configuration.nas_mount_options = None

View File

@ -76,7 +76,7 @@ class TestNexentaNfsDriver(test.TestCase):
self.cfg.nexenta_user = 'user'
self.cfg.nexenta_password = 'pass'
self.cfg.max_over_subscription_ratio = 20.0
self.cfg.nas_ip = '1.1.1.1'
self.cfg.nas_host = '1.1.1.1'
self.cfg.nas_share_path = 'pool/share'
self.nef_mock = mock.Mock()
self.stubs.Set(jsonrpc, 'NexentaJSONProxy',

View File

@ -337,7 +337,7 @@ class NfsDriverTestCase(test.TestCase):
self.configuration.nfs_qcow2_volumes = False
self.configuration.nas_secure_file_permissions = 'false'
self.configuration.nas_secure_file_operations = 'false'
self.configuration.nas_ip = None
self.configuration.nas_host = None
self.configuration.nas_share_path = None
self.configuration.nas_mount_options = None
self.configuration.volume_dd_blocksize = '1M'
@ -495,7 +495,7 @@ class NfsDriverTestCase(test.TestCase):
def test_load_shares_config_nas_opts(self):
drv = self._driver
drv.configuration.nas_ip = self.TEST_NFS_HOST
drv.configuration.nas_host = self.TEST_NFS_HOST
drv.configuration.nas_share_path = self.TEST_NFS_SHARE_PATH
drv.configuration.nfs_shares_config = self.TEST_SHARES_CONFIG_FILE

View File

@ -1244,7 +1244,7 @@ class GPFSNFSDriver(GPFSDriver, nfs.NfsDriver, san.SanDriver):
super(GPFSNFSDriver, self).__init__(*args, **kwargs)
self.gpfs_execute = self._gpfs_remote_execute
self.configuration.append_config_values(remotefs.nas_opts)
self.configuration.san_ip = self.configuration.nas_ip
self.configuration.san_ip = self.configuration.nas_host
self.configuration.san_login = self.configuration.nas_login
self.configuration.san_password = self.configuration.nas_password
self.configuration.san_private_key = (

View File

@ -67,7 +67,7 @@ class NexentaNfsDriver(nfs.NfsDriver): # pylint: disable=R0921
self.sparsed_volumes = self.configuration.nexenta_sparsed_volumes
self.nef = None
self.nef_protocol = self.configuration.nexenta_rest_protocol
self.nef_host = self.configuration.nas_ip
self.nef_host = self.configuration.nas_host
self.share = self.configuration.nas_share_path
self.nef_port = self.configuration.nexenta_rest_port
self.nef_user = self.configuration.nexenta_user

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)

View File

@ -0,0 +1,7 @@
---
deprecations:
- Deprecate the nas_ip configuration option
and change it to nas_host. It will be more
clear to use the nas_host configuration
option instead of the nas_ip as IP address
or Hostname of NAS system.