Remove support for `data_node_access_ip`

It was deprecated in the Queens release, in
favor of ``data_node_access_ips``.

Change-Id: I01f24c2e0d66e1da4c30c579c02afc8f3930c8f8
Related-Bug: #1745436
This commit is contained in:
Goutham Pacha Ravi 2019-07-30 12:54:57 -07:00
parent 8d03a2a46e
commit 9551623c22
7 changed files with 23 additions and 24 deletions

View File

@ -405,10 +405,10 @@ function configure_data_service_generic_driver {
if [[ $share_driver == $generic_driver ]]; then if [[ $share_driver == $generic_driver ]]; then
driver_handles_share_servers=$(iniget $MANILA_CONF ${enabled_backends[0]} driver_handles_share_servers) driver_handles_share_servers=$(iniget $MANILA_CONF ${enabled_backends[0]} driver_handles_share_servers)
if [[ $(trueorfalse False driver_handles_share_servers) == False ]]; then if [[ $(trueorfalse False driver_handles_share_servers) == False ]]; then
iniset $MANILA_CONF DEFAULT data_node_access_ip $PUBLIC_NETWORK_GATEWAY iniset $MANILA_CONF DEFAULT data_node_access_ips $PUBLIC_NETWORK_GATEWAY
else else
if ! [[ -z $MANILA_DATA_NODE_IP ]]; then if ! [[ -z $MANILA_DATA_NODE_IP ]]; then
iniset $MANILA_CONF DEFAULT data_node_access_ip $MANILA_DATA_NODE_IP iniset $MANILA_CONF DEFAULT data_node_access_ips $MANILA_DATA_NODE_IP
fi fi
fi fi
fi fi
@ -658,7 +658,7 @@ function init_manila {
cat $STACK_HOME/.ssh/*.pub >> $SSH_USER_HOME/.ssh/authorized_keys cat $STACK_HOME/.ssh/*.pub >> $SSH_USER_HOME/.ssh/authorized_keys
# Give ssh user sudo access # Give ssh user sudo access
echo "$MANILA_ZFSONLINUX_SSH_USERNAME ALL=(ALL) NOPASSWD: ALL" | sudo tee -a /etc/sudoers > /dev/null echo "$MANILA_ZFSONLINUX_SSH_USERNAME ALL=(ALL) NOPASSWD: ALL" | sudo tee -a /etc/sudoers > /dev/null
iniset $MANILA_CONF DEFAULT data_node_access_ip $MANILA_ZFSONLINUX_SERVICE_IP iniset $MANILA_CONF DEFAULT data_node_access_ips $MANILA_ZFSONLINUX_SERVICE_IP
fi fi
fi fi
fi fi
@ -815,7 +815,7 @@ function configure_samba {
iniset $MANILA_CONF $backend_name driver_handles_share_servers False iniset $MANILA_CONF $backend_name driver_handles_share_servers False
iniset $MANILA_CONF $backend_name lvm_share_export_ips $MANILA_LVM_SHARE_EXPORT_IPS iniset $MANILA_CONF $backend_name lvm_share_export_ips $MANILA_LVM_SHARE_EXPORT_IPS
done done
iniset $MANILA_CONF DEFAULT data_node_access_ip $HOST_IP iniset $MANILA_CONF DEFAULT data_node_access_ips $HOST_IP
fi fi
} }
@ -1062,14 +1062,14 @@ function setup_ipv6 {
for backend_name in ${MANILA_ENABLED_BACKENDS//,/ }; do for backend_name in ${MANILA_ENABLED_BACKENDS//,/ }; do
iniset $MANILA_CONF $backend_name lvm_share_export_ips $public_gateway_ipv4,$public_gateway_ipv6 iniset $MANILA_CONF $backend_name lvm_share_export_ips $public_gateway_ipv4,$public_gateway_ipv6
done done
iniset $MANILA_CONF DEFAULT data_node_access_ip $public_gateway_ipv4 iniset $MANILA_CONF DEFAULT data_node_access_ips $public_gateway_ipv4
fi fi
if [ "$SHARE_DRIVER" == "manila.share.drivers.cephfs.driver.CephFSDriver" ]; then if [ "$SHARE_DRIVER" == "manila.share.drivers.cephfs.driver.CephFSDriver" ]; then
for backend_name in ${MANILA_ENABLED_BACKENDS//,/ }; do for backend_name in ${MANILA_ENABLED_BACKENDS//,/ }; do
iniset $MANILA_CONF $backend_name cephfs_ganesha_export_ips $public_gateway_ipv4,$public_gateway_ipv6 iniset $MANILA_CONF $backend_name cephfs_ganesha_export_ips $public_gateway_ipv4,$public_gateway_ipv6
done done
iniset $MANILA_CONF DEFAULT data_node_access_ip $public_gateway_ipv4 iniset $MANILA_CONF DEFAULT data_node_access_ips $public_gateway_ipv4
fi fi
# install Quagga for setting up the host routes dynamically # install Quagga for setting up the host routes dynamically

View File

@ -186,9 +186,10 @@ must use manila share access APIs to grant access to mount the instances.
The access rule type varies according to the share protocol, so there are a few The access rule type varies according to the share protocol, so there are a few
config options to set the access value for each type: config options to set the access value for each type:
* ``data_node_access_ip``: For IP-based access type, provide the value of the * ``data_node_access_ips``: For IP-based access type, provide one or more
IP of the Data Service node in the administrator network. For NFS shares, administrator network IP addresses of the host running the Data Service.
drivers should always add rules with the "no_root_squash" property. For NFS shares, drivers should always add rules with the "no_root_squash"
property.
* ``data_node_access_cert``: For certificate-based access type, provide the * ``data_node_access_cert``: For certificate-based access type, provide the
value of the certificate name that grants access to the Data Service. value of the certificate name that grants access to the Data Service.

View File

@ -331,7 +331,7 @@ Extra configuration is needed for allowing shares to be migrated from or to
HNAS. In the OpenStack deployment, the manila-share node needs an additional HNAS. In the OpenStack deployment, the manila-share node needs an additional
connection to the EVS data interface. Furthermore, make sure to add connection to the EVS data interface. Furthermore, make sure to add
``hitachi_hnas_admin_network_ip`` to the configuration. This should match the ``hitachi_hnas_admin_network_ip`` to the configuration. This should match the
value of ``data_node_access_ip``. For more in-depth documentation, value of ``data_node_access_ips``. For more in-depth documentation,
refer to the `share migration documents refer to the `share migration documents
<https://docs.openstack.org/manila/latest/admin/shared-file-systems-share-migration.html>`_ <https://docs.openstack.org/manila/latest/admin/shared-file-systems-share-migration.html>`_

View File

@ -32,8 +32,8 @@
- (String) The admin user name registered in the security service in order to allow access to user authentication-based shares. - (String) The admin user name registered in the security service in order to allow access to user authentication-based shares.
* - ``data_node_access_cert`` = ``None`` * - ``data_node_access_cert`` = ``None``
- (String) The certificate installed in the data node in order to allow access to certificate authentication-based shares. - (String) The certificate installed in the data node in order to allow access to certificate authentication-based shares.
* - ``data_node_access_ip`` = ``None`` * - ``data_node_access_ips`` = ``None``
- (String) The IP of the node interface connected to the admin network. Used for allowing access to the mounting shares. - (String) A list of the IPs of the node interface connected to the admin network. Used for allowing access to the mounting shares. Default is [].
* - ``data_node_mount_options`` = ``{}`` * - ``data_node_mount_options`` = ``{}``
- (Dict) Mount options to be included in the mount command for share protocols. Use dictionary format, example: {'nfs': '-o nfsvers=3', 'cifs': '-o user=foo,pass=bar'} - (Dict) Mount options to be included in the mount command for share protocols. Use dictionary format, example: {'nfs': '-o nfsvers=3', 'cifs': '-o user=foo,pass=bar'}
* - ``data_topic`` = ``manila-data`` * - ``data_topic`` = ``manila-data``

View File

@ -39,14 +39,6 @@ data_helper_opts = [
help="A list of the IPs of the node interface connected to " help="A list of the IPs of the node interface connected to "
"the admin network. Used for allowing access to the " "the admin network. Used for allowing access to the "
"mounting shares. Default is []."), "mounting shares. Default is []."),
cfg.StrOpt(
'data_node_access_ip',
help="The IP of the node interface connected to the admin network. "
"Used for allowing access to the mounting shares.",
deprecated_for_removal=True,
deprecated_reason="New config option 'data_node_access_ips' added "
"to support multiple IPs, including IPv6 addresses "
"alongside IPv4."),
cfg.StrOpt( cfg.StrOpt(
'data_node_access_cert', 'data_node_access_cert',
help="The certificate installed in the data node in order to " help="The certificate installed in the data node in order to "
@ -217,7 +209,7 @@ class DataServiceHelper(object):
if access_type.lower() == 'cert' and CONF.data_node_access_cert: if access_type.lower() == 'cert' and CONF.data_node_access_cert:
access_to_list.append(CONF.data_node_access_cert) access_to_list.append(CONF.data_node_access_cert)
elif access_type.lower() == 'ip': elif access_type.lower() == 'ip':
ips = CONF.data_node_access_ips or CONF.data_node_access_ip ips = CONF.data_node_access_ips
if ips: if ips:
if not isinstance(ips, list): if not isinstance(ips, list):
ips = [ips] ips = [ips]

View File

@ -124,7 +124,7 @@ class DataServiceHelperTestCase(test.TestCase):
def test__get_access_entries_according_to_mapping(self, mapping): def test__get_access_entries_according_to_mapping(self, mapping):
data_copy_helper.CONF.data_node_access_cert = 'fake' data_copy_helper.CONF.data_node_access_cert = 'fake'
data_copy_helper.CONF.data_node_access_ip = 'fake' data_copy_helper.CONF.data_node_access_ips = 'fake'
data_copy_helper.CONF.data_node_access_admin_user = 'fake' data_copy_helper.CONF.data_node_access_admin_user = 'fake'
expected = [{ expected = [{
'access_type': list(mapping.keys())[0], 'access_type': list(mapping.keys())[0],
@ -145,7 +145,7 @@ class DataServiceHelperTestCase(test.TestCase):
def test__get_access_entries_according_to_mapping_exception_not_set(self): def test__get_access_entries_according_to_mapping_exception_not_set(self):
data_copy_helper.CONF.data_node_access_ip = None data_copy_helper.CONF.data_node_access_ips = None
self.assertRaises( self.assertRaises(
exception.ShareDataCopyFailed, exception.ShareDataCopyFailed,
@ -155,7 +155,6 @@ class DataServiceHelperTestCase(test.TestCase):
ips = ['fake1', 'fake2'] ips = ['fake1', 'fake2']
data_copy_helper.CONF.data_node_access_ips = ips data_copy_helper.CONF.data_node_access_ips = ips
data_copy_helper.CONF.data_node_access_ip = None
expected = [{ expected = [{
'access_type': 'ip', 'access_type': 'ip',

View File

@ -0,0 +1,7 @@
---
upgrade:
- |
The configuration option for the manila-data service,
``data_node_access_ip`` from the [DEFAULT] section is no longer
supported. It was deprecated in favor of ``data_node_access_ips`` in the
OpenStack Shared File Systems (manila) service release 6.0.0 (Queens).