Use HostAddressOpt for opts that accept IP and hostnames
Some configuration options were accepting both IP addresses and hostnames. Since there was no specific OSLO opt type to support this, we were using ``StrOpt``. The change [1] that added support for ``HostAddressOpt`` type was merged in Ocata and became available for use with oslo version 3.22. This patch changes the opt type of configuration options to use this more relevant opt type - HostAddressOpt. [1] I77bdb64b7e6e56ce761d76696bc4448a9bd325eb TrivialFix Change-Id: I44ba478ff14a6184434dd030efd9b7fa92458c7a
This commit is contained in:
parent
80b54ad59d
commit
86a1bc189c
@ -58,7 +58,7 @@ CONF.register_cli_opts(core_opts)
|
||||
CONF.register_cli_opts(debug_opts)
|
||||
|
||||
global_opts = [
|
||||
cfg.StrOpt('my_ip',
|
||||
cfg.HostAddressOpt('my_ip',
|
||||
default=netutils.get_my_ipv4(),
|
||||
sample_default='<your_ip>',
|
||||
help='IP address of this host.'),
|
||||
@ -107,11 +107,12 @@ global_opts = [
|
||||
cfg.StrOpt('data_manager',
|
||||
default='manila.data.manager.DataManager',
|
||||
help='Full class name for the data manager.'),
|
||||
cfg.StrOpt('host',
|
||||
cfg.HostAddressOpt('host',
|
||||
default=socket.gethostname(),
|
||||
sample_default='<your_hostname>',
|
||||
help='Name of this node. This can be an opaque identifier. '
|
||||
'It is not necessarily a hostname, FQDN, or IP address.'),
|
||||
help='Name of this node. This can be an opaque '
|
||||
'identifier. It is not necessarily a hostname, '
|
||||
'FQDN, or IP address.'),
|
||||
# NOTE(vish): default to nova for compatibility with nova installs
|
||||
cfg.StrOpt('storage_availability_zone',
|
||||
default='nova',
|
||||
|
@ -51,9 +51,10 @@ service_opts = [
|
||||
help='Range of seconds to randomly delay when starting the '
|
||||
'periodic task scheduler to reduce stampeding. '
|
||||
'(Disable by setting to 0)'),
|
||||
cfg.StrOpt('osapi_share_listen',
|
||||
cfg.HostAddressOpt('osapi_share_listen',
|
||||
default="::",
|
||||
help='IP address for OpenStack Share API to listen on.'),
|
||||
help='IP address for OpenStack Share API to listen '
|
||||
'on.'),
|
||||
cfg.PortOpt('osapi_share_listen_port',
|
||||
default=8786,
|
||||
help='Port for OpenStack Share API to listen on.'),
|
||||
|
@ -30,7 +30,7 @@ EMC_NAS_OPTS = [
|
||||
help='User name for the EMC server.'),
|
||||
cfg.StrOpt('emc_nas_password',
|
||||
help='Password for the EMC server.'),
|
||||
cfg.StrOpt('emc_nas_server',
|
||||
cfg.HostAddressOpt('emc_nas_server',
|
||||
help='EMC server hostname or IP address.'),
|
||||
cfg.PortOpt('emc_nas_server_port',
|
||||
default=8080,
|
||||
|
@ -45,7 +45,7 @@ GlusterfsManilaShare_opts = [
|
||||
default='Gluster',
|
||||
help='Type of NFS server that mediate access to the Gluster '
|
||||
'volumes (Gluster or Ganesha).'),
|
||||
cfg.StrOpt('glusterfs_ganesha_server_ip',
|
||||
cfg.HostAddressOpt('glusterfs_ganesha_server_ip',
|
||||
help="Remote Ganesha server node's IP address."),
|
||||
cfg.StrOpt('glusterfs_ganesha_server_username',
|
||||
default='root',
|
||||
|
@ -44,7 +44,7 @@ from manila import utils
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
hdfs_native_share_opts = [
|
||||
cfg.StrOpt('hdfs_namenode_ip',
|
||||
cfg.HostAddressOpt('hdfs_namenode_ip',
|
||||
help='The IP of the HDFS namenode.'),
|
||||
cfg.PortOpt('hdfs_namenode_port',
|
||||
default=9000,
|
||||
|
@ -30,7 +30,7 @@ from manila.share import utils
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
hitachi_hnas_opts = [
|
||||
cfg.StrOpt('hitachi_hnas_ip',
|
||||
cfg.HostAddressOpt('hitachi_hnas_ip',
|
||||
deprecated_name='hds_hnas_ip',
|
||||
help="HNAS management interface IP for communication "
|
||||
"between Manila controller and HNAS."),
|
||||
@ -46,11 +46,12 @@ hitachi_hnas_opts = [
|
||||
cfg.IntOpt('hitachi_hnas_evs_id',
|
||||
deprecated_name='hds_hnas_evs_id',
|
||||
help="Specify which EVS this backend is assigned to."),
|
||||
cfg.StrOpt('hitachi_hnas_evs_ip',
|
||||
cfg.HostAddressOpt('hitachi_hnas_evs_ip',
|
||||
deprecated_name='hds_hnas_evs_ip',
|
||||
help="Specify IP for mounting shares."),
|
||||
cfg.StrOpt('hitachi_hnas_admin_network_ip',
|
||||
help="Specify IP for mounting shares in the Admin network."),
|
||||
cfg.HostAddressOpt('hitachi_hnas_admin_network_ip',
|
||||
help="Specify IP for mounting shares in the Admin "
|
||||
"network."),
|
||||
cfg.StrOpt('hitachi_hnas_file_system_name',
|
||||
deprecated_name='hds_hnas_file_system_name',
|
||||
help="Specify file-system name for creating shares."),
|
||||
@ -59,10 +60,10 @@ hitachi_hnas_opts = [
|
||||
secret=True,
|
||||
help="RSA/DSA private key value used to connect into HNAS. "
|
||||
"Required only if password is not provided."),
|
||||
cfg.StrOpt('hitachi_hnas_cluster_admin_ip0',
|
||||
cfg.HostAddressOpt('hitachi_hnas_cluster_admin_ip0',
|
||||
deprecated_name='hds_hnas_cluster_admin_ip0',
|
||||
help="The IP of the clusters admin node. Only set in HNAS "
|
||||
"multinode clusters."),
|
||||
help="The IP of the clusters admin node. Only set in "
|
||||
"HNAS multinode clusters."),
|
||||
cfg.IntOpt('hitachi_hnas_stalled_job_timeout',
|
||||
deprecated_name='hds_hnas_stalled_job_timeout',
|
||||
default=30,
|
||||
|
@ -27,10 +27,10 @@ from manila.share.drivers.hitachi.hsp import rest
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
hitachi_hsp_opts = [
|
||||
cfg.StrOpt('hitachi_hsp_host',
|
||||
cfg.HostAddressOpt('hitachi_hsp_host',
|
||||
required=True,
|
||||
help="HSP management host for communication between Manila "
|
||||
"controller and HSP."),
|
||||
help="HSP management host for communication between "
|
||||
"Manila controller and HSP."),
|
||||
cfg.StrOpt('hitachi_hsp_username',
|
||||
required=True,
|
||||
help="HSP username to perform tasks such as create filesystems"
|
||||
|
@ -132,8 +132,7 @@ HPE3PAR_OPTS = [
|
||||
help="3PAR password for the user specified in hpe3par_username",
|
||||
secret=True,
|
||||
deprecated_name='hp3par_password'),
|
||||
cfg.StrOpt('hpe3par_san_ip',
|
||||
default='',
|
||||
cfg.HostAddressOpt('hpe3par_san_ip',
|
||||
help="IP address of SAN controller",
|
||||
deprecated_name='hp3par_san_ip'),
|
||||
cfg.StrOpt('hpe3par_san_login',
|
||||
|
@ -60,7 +60,7 @@ AVPATTERN = re.compile(r'\s*(?P<attr>\w+)\s*=\s*(?P<val>'
|
||||
ERR_FILE_NOT_FOUND = 2
|
||||
|
||||
gpfs_share_opts = [
|
||||
cfg.StrOpt('gpfs_share_export_ip',
|
||||
cfg.HostAddressOpt('gpfs_share_export_ip',
|
||||
help='IP to be added to GPFS export string.'),
|
||||
cfg.StrOpt('gpfs_mount_point_base',
|
||||
default='$state_path/mnt',
|
||||
|
@ -30,9 +30,10 @@ netapp_proxy_opts = [
|
||||
'clustered Data ONTAP.')), ]
|
||||
|
||||
netapp_connection_opts = [
|
||||
cfg.StrOpt('netapp_server_hostname',
|
||||
cfg.HostAddressOpt('netapp_server_hostname',
|
||||
deprecated_name='netapp_nas_server_hostname',
|
||||
help='The hostname (or IP address) for the storage system.'),
|
||||
help='The hostname (or IP address) for the storage '
|
||||
'system.'),
|
||||
cfg.PortOpt('netapp_server_port',
|
||||
help=('The TCP port to use for communication with the storage '
|
||||
'system or proxy server. If not specified, Data ONTAP '
|
||||
|
@ -23,7 +23,7 @@
|
||||
from oslo_config import cfg
|
||||
|
||||
nexenta_connection_opts = [
|
||||
cfg.StrOpt('nexenta_host',
|
||||
cfg.HostAddressOpt('nexenta_host',
|
||||
help='IP address of Nexenta storage appliance.'),
|
||||
cfg.IntOpt('nexenta_rest_port',
|
||||
default=8457,
|
||||
|
@ -37,7 +37,7 @@ qnap_manila_opts = [
|
||||
cfg.StrOpt('qnap_management_url',
|
||||
required=True,
|
||||
help='The URL to manage QNAP Storage.'),
|
||||
cfg.StrOpt('qnap_share_ip',
|
||||
cfg.HostAddressOpt('qnap_share_ip',
|
||||
required=True,
|
||||
help='NAS share IP for mounting shares.'),
|
||||
cfg.StrOpt('qnap_nas_login',
|
||||
|
@ -125,13 +125,13 @@ no_share_servers_handling_mode_opts = [
|
||||
"service_instance_name_or_id",
|
||||
help="Name or ID of service instance in Nova to use for share "
|
||||
"exports. Used only when share servers handling is disabled."),
|
||||
cfg.StrOpt(
|
||||
cfg.HostAddressOpt(
|
||||
"service_net_name_or_ip",
|
||||
help="Can be either name of network that is used by service "
|
||||
"instance within Nova to get IP address or IP address itself "
|
||||
"for managing shares there. "
|
||||
"Used only when share servers handling is disabled."),
|
||||
cfg.StrOpt(
|
||||
cfg.HostAddressOpt(
|
||||
"tenant_net_name_or_ip",
|
||||
help="Can be either name of network that is used by service "
|
||||
"instance within Nova to get IP address or IP address itself "
|
||||
|
@ -30,7 +30,7 @@ from manila.share import driver
|
||||
from manila.share import utils as share_utils
|
||||
|
||||
tegile_opts = [
|
||||
cfg.StrOpt('tegile_nas_server',
|
||||
cfg.HostAddressOpt('tegile_nas_server',
|
||||
help='Tegile NAS server hostname or IP address.'),
|
||||
cfg.StrOpt('tegile_nas_login',
|
||||
help='User name for the Tegile NAS server.'),
|
||||
|
@ -41,11 +41,11 @@ from manila import utils
|
||||
|
||||
|
||||
zfsonlinux_opts = [
|
||||
cfg.StrOpt(
|
||||
cfg.HostAddressOpt(
|
||||
"zfs_share_export_ip",
|
||||
required=True,
|
||||
help="IP to be added to user-facing export location. Required."),
|
||||
cfg.StrOpt(
|
||||
cfg.HostAddressOpt(
|
||||
"zfs_service_ip",
|
||||
required=True,
|
||||
help="IP to be added to admin-facing export location. Required."),
|
||||
|
@ -30,9 +30,9 @@ from manila.share.drivers.zfssa import zfssarest
|
||||
|
||||
|
||||
ZFSSA_OPTS = [
|
||||
cfg.StrOpt('zfssa_host',
|
||||
cfg.HostAddressOpt('zfssa_host',
|
||||
help='ZFSSA management IP address.'),
|
||||
cfg.StrOpt('zfssa_data_ip',
|
||||
cfg.HostAddressOpt('zfssa_data_ip',
|
||||
help='IP address for data.'),
|
||||
cfg.StrOpt('zfssa_auth_user',
|
||||
help='ZFSSA management authorized username.'),
|
||||
|
@ -38,7 +38,7 @@ class ManilaCmdShareTestCase(test.TestCase):
|
||||
self.mock_object(self.launcher, 'launch_service')
|
||||
self.mock_object(self.launcher, 'wait')
|
||||
self.server = manila_share.service.Service.create.return_value
|
||||
fake_host = 'fake_host'
|
||||
fake_host = 'fake.host'
|
||||
CONF.set_override('enabled_share_backends', backends,
|
||||
enforce_type=True)
|
||||
CONF.set_override('host', fake_host, enforce_type=True)
|
||||
|
@ -60,7 +60,7 @@ class NetAppCDOTDataMotionTestCase(test.TestCase):
|
||||
group=self.backend, enforce_type=True)
|
||||
CONF.set_override("netapp_password", "fake_password",
|
||||
group=self.backend, enforce_type=True)
|
||||
CONF.set_override("netapp_server_hostname", "fake_hostname",
|
||||
CONF.set_override("netapp_server_hostname", "fake.hostname",
|
||||
group=self.backend, enforce_type=True)
|
||||
CONF.set_override("netapp_server_port", 8866,
|
||||
group=self.backend, enforce_type=True)
|
||||
@ -72,7 +72,7 @@ class NetAppCDOTDataMotionTestCase(test.TestCase):
|
||||
data_motion.get_client_for_backend(self.backend)
|
||||
|
||||
self.mock_cmode_client.assert_called_once_with(
|
||||
hostname='fake_hostname', password='fake_password',
|
||||
hostname='fake.hostname', password='fake_password',
|
||||
username='fake_user', transport_type='https', port=8866,
|
||||
trace=mock.ANY, vserver=None)
|
||||
|
||||
@ -86,7 +86,7 @@ class NetAppCDOTDataMotionTestCase(test.TestCase):
|
||||
data_motion.get_client_for_backend(self.backend)
|
||||
|
||||
self.mock_cmode_client.assert_called_once_with(
|
||||
hostname='fake_hostname', password='fake_password',
|
||||
hostname='fake.hostname', password='fake_password',
|
||||
username='fake_user', transport_type='https', port=8866,
|
||||
trace=mock.ANY, vserver='fake_vserver')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user