Fix ironic client ironic_url deprecation warning

In preparation for stein, use 'endpoint' instead of 'ironic_url'
when calling get_client in order to remove the following warning:

WARNING ironicclient.client The argument "ironic_url" passed to
get_client is deprecated and will be removed in Stein release,
please use "endpoint" instead.

For reference:
In the python-ironicclient code, in the ironicclient/client.py#L24
TODO(vdrok): remove in Stein
[...]
  ('ironic_url',): 'endpoint',

Introduced in commit:
58c39b7a80

Change-Id: I1b3ce1955622c40b780c0b15ec7e09be3e8ace72
This commit is contained in:
Daniel Abad 2018-10-19 15:22:33 +02:00
parent d7e76f8cad
commit 35f49f4035
5 changed files with 9 additions and 9 deletions

View File

@ -128,7 +128,7 @@ python-cinderclient==3.3.0
python-dateutil==2.5.3 python-dateutil==2.5.3
python-editor==1.0.3 python-editor==1.0.3
python-glanceclient==2.8.0 python-glanceclient==2.8.0
python-ironicclient==2.3.0 python-ironicclient==2.4.0
python-keystoneclient==3.15.0 python-keystoneclient==3.15.0
python-mimeparse==1.6.0 python-mimeparse==1.6.0
python-neutronclient==6.7.0 python-neutronclient==6.7.0

View File

@ -56,7 +56,7 @@ def _get_ironic_client():
'os_service_type': 'baremetal', 'os_service_type': 'baremetal',
'os_endpoint_type': 'public', 'os_endpoint_type': 'public',
'insecure': 'true', 'insecure': 'true',
'ironic_url': CONF.ironic.api_endpoint} 'endpoint': CONF.ironic.api_endpoint}
# NOTE(mriedem): The 1 api_version arg here is the only valid value for # NOTE(mriedem): The 1 api_version arg here is the only valid value for
# the client, but it's not even used so it doesn't really matter. The # the client, but it's not even used so it doesn't really matter. The
# ironic client wrapper in the virt driver actually uses a hard-coded # ironic client wrapper in the virt driver actually uses a hard-coded

View File

@ -77,7 +77,7 @@ class IronicClientWrapperTestCase(test.NoDBTestCase):
ironicclient = client_wrapper.IronicClientWrapper() ironicclient = client_wrapper.IronicClientWrapper()
# dummy call to have _get_client() called # dummy call to have _get_client() called
ironicclient.call("node.list") ironicclient.call("node.list")
# With no api_endpoint in the conf, ironic_url is retrieved from # With no api_endpoint in the conf, endpoint is retrieved from
# nova.utils.get_ksa_adapter().get_endpoint() # nova.utils.get_ksa_adapter().get_endpoint()
self.get_ksa_adapter.assert_called_once_with( self.get_ksa_adapter.assert_called_once_with(
'baremetal', ksa_auth=self.get_auth_plugin.return_value, 'baremetal', ksa_auth=self.get_auth_plugin.return_value,
@ -87,7 +87,7 @@ class IronicClientWrapperTestCase(test.NoDBTestCase):
'max_retries': CONF.ironic.api_max_retries, 'max_retries': CONF.ironic.api_max_retries,
'retry_interval': CONF.ironic.api_retry_interval, 'retry_interval': CONF.ironic.api_retry_interval,
'os_ironic_api_version': ['1.38', '1.37'], 'os_ironic_api_version': ['1.38', '1.37'],
'ironic_url': 'endpoint':
self.get_ksa_adapter.return_value.get_endpoint.return_value} self.get_ksa_adapter.return_value.get_endpoint.return_value}
mock_ir_cli.assert_called_once_with(1, **expected) mock_ir_cli.assert_called_once_with(1, **expected)
@ -102,7 +102,7 @@ class IronicClientWrapperTestCase(test.NoDBTestCase):
ironicclient = client_wrapper.IronicClientWrapper() ironicclient = client_wrapper.IronicClientWrapper()
# dummy call to have _get_client() called # dummy call to have _get_client() called
ironicclient.call("node.list") ironicclient.call("node.list")
# With no api_endpoint in the conf, ironic_url is retrieved from # With no api_endpoint in the conf, endpoint is retrieved from
# nova.utils.get_endpoint_data # nova.utils.get_endpoint_data
self.get_ksa_adapter.assert_called_once_with( self.get_ksa_adapter.assert_called_once_with(
'baremetal', ksa_auth=self.get_auth_plugin.return_value, 'baremetal', ksa_auth=self.get_auth_plugin.return_value,
@ -113,7 +113,7 @@ class IronicClientWrapperTestCase(test.NoDBTestCase):
'max_retries': CONF.ironic.api_max_retries, 'max_retries': CONF.ironic.api_max_retries,
'retry_interval': CONF.ironic.api_retry_interval, 'retry_interval': CONF.ironic.api_retry_interval,
'os_ironic_api_version': ['1.38', '1.37'], 'os_ironic_api_version': ['1.38', '1.37'],
'ironic_url': None} 'endpoint': None}
mock_ir_cli.assert_called_once_with(1, **expected) mock_ir_cli.assert_called_once_with(1, **expected)
@mock.patch.object(keystoneauth1.session, 'Session') @mock.patch.object(keystoneauth1.session, 'Session')
@ -131,7 +131,7 @@ class IronicClientWrapperTestCase(test.NoDBTestCase):
'max_retries': CONF.ironic.api_max_retries, 'max_retries': CONF.ironic.api_max_retries,
'retry_interval': CONF.ironic.api_retry_interval, 'retry_interval': CONF.ironic.api_retry_interval,
'os_ironic_api_version': ['1.38', '1.37'], 'os_ironic_api_version': ['1.38', '1.37'],
'ironic_url': endpoint} 'endpoint': endpoint}
mock_ir_cli.assert_called_once_with(1, **expected) mock_ir_cli.assert_called_once_with(1, **expected)
@mock.patch.object(client_wrapper.IronicClientWrapper, '_multi_getattr') @mock.patch.object(client_wrapper.IronicClientWrapper, '_multi_getattr')

View File

@ -122,7 +122,7 @@ class IronicClientWrapper(object):
try: try:
cli = ironic.client.get_client(IRONIC_API_VERSION[0], cli = ironic.client.get_client(IRONIC_API_VERSION[0],
ironic_url=ironic_url, endpoint=ironic_url,
session=sess, **kwargs) session=sess, **kwargs)
# Cache the client so we don't have to reconstruct and # Cache the client so we don't have to reconstruct and
# reauthenticate it every time we need it. # reauthenticate it every time we need it.

View File

@ -11,7 +11,7 @@ mox3>=0.20.0 # Apache-2.0
psycopg2>=2.6.2 # LGPL/ZPL psycopg2>=2.6.2 # LGPL/ZPL
PyMySQL>=0.7.6 # MIT License PyMySQL>=0.7.6 # MIT License
python-barbicanclient>=4.5.2 # Apache-2.0 python-barbicanclient>=4.5.2 # Apache-2.0
python-ironicclient>=2.3.0 # Apache-2.0 python-ironicclient>=2.4.0 # Apache-2.0
requests-mock>=1.2.0 # Apache-2.0 requests-mock>=1.2.0 # Apache-2.0
oslotest>=3.2.0 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0
stestr>=1.0.0 # Apache-2.0 stestr>=1.0.0 # Apache-2.0