From 519ca2c9fb5bb3afa7343574a2c6d8c6389751e9 Mon Sep 17 00:00:00 2001 From: licanwei Date: Sat, 21 Sep 2019 08:54:11 +0800 Subject: [PATCH] Fix unit test failed ironic removed 'os_endpoint_type' and instead with 'interface' Change-Id: Ifa21645e19b8311de35cb9b0b8f39371b8713a2f --- lower-constraints.txt | 2 +- requirements.txt | 2 +- watcher/common/clients.py | 2 +- watcher/tests/common/test_clients.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lower-constraints.txt b/lower-constraints.txt index c83c905f5..5fdf6a543 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -113,7 +113,7 @@ python-cinderclient==3.5.0 python-dateutil==2.7.0 python-editor==1.0.3 python-glanceclient==2.9.1 -python-ironicclient==2.3.0 +python-ironicclient==2.5.0 python-keystoneclient==3.15.0 python-mimeparse==1.6.0 python-monascaclient==1.12.0 diff --git a/requirements.txt b/requirements.txt index e3d530005..cc65597b4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -39,7 +39,7 @@ python-monascaclient>=1.12.0 # Apache-2.0 python-neutronclient>=6.7.0 # Apache-2.0 python-novaclient>=14.1.0 # Apache-2.0 python-openstackclient>=3.14.0 # Apache-2.0 -python-ironicclient>=2.3.0 # Apache-2.0 +python-ironicclient>=2.5.0 # Apache-2.0 six>=1.11.0 # MIT SQLAlchemy>=1.2.5 # MIT stevedore>=1.28.0 # Apache-2.0 diff --git a/watcher/common/clients.py b/watcher/common/clients.py index a71eabc64..f73adc78f 100755 --- a/watcher/common/clients.py +++ b/watcher/common/clients.py @@ -260,7 +260,7 @@ class OpenStackClients(object): endpoint_type = self._get_client_option('ironic', 'endpoint_type') ironic_region_name = self._get_client_option('ironic', 'region_name') self._ironic = irclient.get_client(ironicclient_version, - os_endpoint_type=endpoint_type, + interface=endpoint_type, region_name=ironic_region_name, session=self.session) return self._ironic diff --git a/watcher/tests/common/test_clients.py b/watcher/tests/common/test_clients.py index 71947a57a..3b9f3cc80 100755 --- a/watcher/tests/common/test_clients.py +++ b/watcher/tests/common/test_clients.py @@ -437,7 +437,7 @@ class TestClients(base.TestCase): osc = clients.OpenStackClients() osc._ironic = None osc.ironic() - mock_session.get_endpoint.assert_called_once_with( + mock_session.get_endpoint.assert_called_with( interface='publicURL', region_name=None, service_type='baremetal')