Remove deprecated [designate] admin_* parameters
These were deprecated during Xena cycle[1], so can be removed now.
[1] adfd853267
Related-Bug: #1927494
Change-Id: I9fadaa6cfcd66409da47422505c145d9d67f6b8c
This commit is contained in:
parent
dfa6dc4c0e
commit
46c1220b38
@ -21,42 +21,6 @@ from neutron._i18n import _
|
||||
designate_opts = [
|
||||
cfg.StrOpt('url',
|
||||
help=_('URL for connecting to designate')),
|
||||
cfg.StrOpt('admin_username',
|
||||
deprecated_for_removal=True,
|
||||
deprecated_since='Xena',
|
||||
deprecated_reason=("This option will be completely replaced by "
|
||||
"keystoneauth parameters."),
|
||||
help=_('Username for connecting to designate in admin '
|
||||
'context')),
|
||||
cfg.StrOpt('admin_password',
|
||||
deprecated_for_removal=True,
|
||||
deprecated_since='Xena',
|
||||
deprecated_reason=("This option will be completely replaced by "
|
||||
"keystoneauth parameters."),
|
||||
help=_('Password for connecting to designate in admin '
|
||||
'context'),
|
||||
secret=True),
|
||||
cfg.StrOpt('admin_tenant_id',
|
||||
deprecated_for_removal=True,
|
||||
deprecated_since='Xena',
|
||||
deprecated_reason=("This option will be completely replaced by "
|
||||
"keystoneauth parameters."),
|
||||
help=_('Tenant id for connecting to designate in admin '
|
||||
'context')),
|
||||
cfg.StrOpt('admin_tenant_name',
|
||||
deprecated_for_removal=True,
|
||||
deprecated_since='Xena',
|
||||
deprecated_reason=("This option will be completely replaced by "
|
||||
"keystoneauth parameters."),
|
||||
help=_('Tenant name for connecting to designate in admin '
|
||||
'context')),
|
||||
cfg.StrOpt('admin_auth_url',
|
||||
deprecated_for_removal=True,
|
||||
deprecated_since='Xena',
|
||||
deprecated_reason=("This option will be completely replaced by "
|
||||
"keystoneauth parameters."),
|
||||
help=_('Authorization URL for connecting to designate in admin '
|
||||
'context')),
|
||||
cfg.BoolOpt('allow_reverse_dns_lookup', default=True,
|
||||
help=_('Allow the creation of PTR records')),
|
||||
cfg.IntOpt(
|
||||
|
@ -17,7 +17,6 @@ import netaddr
|
||||
|
||||
from designateclient import exceptions as d_exc
|
||||
from designateclient.v2 import client as d_client
|
||||
from keystoneauth1.identity.generic import password
|
||||
from keystoneauth1 import loading
|
||||
from keystoneauth1 import token_endpoint
|
||||
from neutron_lib import constants
|
||||
@ -50,17 +49,7 @@ def get_clients(context):
|
||||
|
||||
auth = token_endpoint.Token(CONF.designate.url, context.auth_token)
|
||||
client = d_client.Client(session=_SESSION, auth=auth)
|
||||
if CONF.designate.auth_type:
|
||||
admin_auth = loading.load_auth_from_conf_options(
|
||||
CONF, 'designate')
|
||||
else:
|
||||
# TODO(tkajinam): Make this fail when admin_* parameters are removed.
|
||||
admin_auth = password.Password(
|
||||
auth_url=CONF.designate.admin_auth_url,
|
||||
username=CONF.designate.admin_username,
|
||||
password=CONF.designate.admin_password,
|
||||
tenant_name=CONF.designate.admin_tenant_name,
|
||||
tenant_id=CONF.designate.admin_tenant_id)
|
||||
admin_auth = loading.load_auth_from_conf_options(CONF, 'designate')
|
||||
admin_client = d_client.Client(session=_SESSION, auth=admin_auth,
|
||||
endpoint_override=CONF.designate.url)
|
||||
return client, admin_client
|
||||
|
@ -760,83 +760,6 @@ class DNSDomainPortsTestCase(DNSIntegrationTestCase):
|
||||
dns_data_db, dns_data_db_1, dns_data_db_2)
|
||||
|
||||
|
||||
class TestDesignateClientKeystoneV2(testtools.TestCase):
|
||||
"""Test case for designate clients """
|
||||
|
||||
TEST_URL = 'http://127.0.0.1:9001/v2'
|
||||
TEST_ADMIN_USERNAME = uuidutils.generate_uuid(dashed=False)
|
||||
TEST_ADMIN_PASSWORD = uuidutils.generate_uuid(dashed=False)
|
||||
TEST_ADMIN_TENANT_NAME = uuidutils.generate_uuid(dashed=False)
|
||||
TEST_ADMIN_TENANT_ID = uuidutils.generate_uuid(dashed=False)
|
||||
TEST_ADMIN_AUTH_URL = 'http://127.0.0.1:35357/v2.0'
|
||||
TEST_CA_CERT = uuidutils.generate_uuid(dashed=False)
|
||||
|
||||
TEST_CONTEXT = mock.Mock()
|
||||
TEST_CONTEXT.auth_token = uuidutils.generate_uuid(dashed=False)
|
||||
|
||||
def setUp(self):
|
||||
super(TestDesignateClientKeystoneV2, self).setUp()
|
||||
cfg.CONF.set_override('url',
|
||||
self.TEST_URL,
|
||||
group='designate')
|
||||
cfg.CONF.set_override('admin_username',
|
||||
self.TEST_ADMIN_USERNAME,
|
||||
group='designate')
|
||||
cfg.CONF.set_override('admin_password',
|
||||
self.TEST_ADMIN_PASSWORD,
|
||||
group='designate')
|
||||
cfg.CONF.set_override('admin_auth_url',
|
||||
self.TEST_ADMIN_AUTH_URL,
|
||||
group='designate')
|
||||
cfg.CONF.set_override('admin_tenant_id',
|
||||
self.TEST_ADMIN_TENANT_ID,
|
||||
group='designate')
|
||||
cfg.CONF.set_override('admin_tenant_name',
|
||||
self.TEST_ADMIN_TENANT_NAME,
|
||||
group='designate')
|
||||
|
||||
# enforce session recalculation
|
||||
mock.patch.object(driver, '_SESSION', new=None).start()
|
||||
self.driver_session = (
|
||||
mock.patch.object(session, 'Session').start())
|
||||
self.load_auth = (
|
||||
mock.patch.object(driver.loading,
|
||||
'load_auth_from_conf_options').start())
|
||||
self.password = (
|
||||
mock.patch.object(driver.password, 'Password').start())
|
||||
|
||||
def test_insecure_client(self):
|
||||
cfg.CONF.set_override('insecure',
|
||||
True,
|
||||
group='designate')
|
||||
driver.get_clients(self.TEST_CONTEXT)
|
||||
args, kwargs = self.driver_session.call_args
|
||||
self.assertIn('verify', kwargs)
|
||||
self.assertFalse(kwargs['verify'], False)
|
||||
|
||||
def test_secure_client(self):
|
||||
cfg.CONF.set_override('insecure',
|
||||
False,
|
||||
group='designate')
|
||||
cfg.CONF.set_override('cafile',
|
||||
self.TEST_CA_CERT,
|
||||
group='designate')
|
||||
driver.get_clients(self.TEST_CONTEXT)
|
||||
args, kwargs = self.driver_session.call_args
|
||||
self.assertIn('verify', kwargs)
|
||||
self.assertEqual(kwargs['verify'], self.TEST_CA_CERT)
|
||||
|
||||
def test_auth_type_not_defined(self):
|
||||
driver.get_clients(self.TEST_CONTEXT)
|
||||
self.load_auth.assert_not_called()
|
||||
self.password.assert_called_with(
|
||||
auth_url=self.TEST_ADMIN_AUTH_URL,
|
||||
password=self.TEST_ADMIN_PASSWORD,
|
||||
tenant_id=self.TEST_ADMIN_TENANT_ID,
|
||||
tenant_name=self.TEST_ADMIN_TENANT_NAME,
|
||||
username=self.TEST_ADMIN_USERNAME)
|
||||
|
||||
|
||||
class TestDesignateClientKeystoneV3(testtools.TestCase):
|
||||
"""Test case for designate clients """
|
||||
|
||||
@ -890,8 +813,6 @@ class TestDesignateClientKeystoneV3(testtools.TestCase):
|
||||
self.load_auth = (
|
||||
mock.patch.object(driver.loading,
|
||||
'load_auth_from_conf_options').start())
|
||||
self.password = (
|
||||
mock.patch.object(driver.password, 'Password').start())
|
||||
|
||||
def test_insecure_client(self):
|
||||
cfg.CONF.set_override('insecure',
|
||||
@ -917,4 +838,3 @@ class TestDesignateClientKeystoneV3(testtools.TestCase):
|
||||
def test_auth_type_password(self):
|
||||
driver.get_clients(self.TEST_CONTEXT)
|
||||
self.load_auth.assert_called_with(cfg.CONF, 'designate')
|
||||
self.password.assert_not_called()
|
||||
|
@ -0,0 +1,11 @@
|
||||
---
|
||||
upgrade:
|
||||
- |
|
||||
The following parameters in the ``designate`` section have been removed.
|
||||
|
||||
- ``admin_username``
|
||||
- ``admin_password``
|
||||
- ``admin_tenant_id``
|
||||
- ``admin_tenant_name``
|
||||
- ``admin_auth_url``
|
||||
|
Loading…
Reference in New Issue
Block a user