diff --git a/senlin/drivers/openstack/sdk.py b/senlin/drivers/openstack/sdk.py index 56f02803a..dacba29b4 100644 --- a/senlin/drivers/openstack/sdk.py +++ b/senlin/drivers/openstack/sdk.py @@ -100,7 +100,7 @@ def create_connection(params=None): params.pop('region_name') try: conn = connection.Connection(profile=prof, user_agent=USER_AGENT, - **params) + auth_plugin="password", **params) except Exception as ex: raise parse_exception(ex) diff --git a/senlin/tests/unit/drivers/test_sdk.py b/senlin/tests/unit/drivers/test_sdk.py index 7ec3b3b58..37be4bcf3 100644 --- a/senlin/tests/unit/drivers/test_sdk.py +++ b/senlin/tests/unit/drivers/test_sdk.py @@ -142,6 +142,7 @@ class OpenStackSDKTest(base.SenlinTestCase): mock_profile.assert_called_once_with() mock_conn.assert_called_once_with(profile=x_profile, user_agent=sdk.USER_AGENT, + auth_plugin="password", foo='bar') @mock.patch.object(profile, 'Profile') @@ -159,7 +160,8 @@ class OpenStackSDKTest(base.SenlinTestCase): x_profile.set_region.assert_called_once_with(x_profile.ALL, 'REGION_ONE') mock_conn.assert_called_once_with(profile=x_profile, - user_agent=sdk.USER_AGENT) + user_agent=sdk.USER_AGENT, + auth_plugin="password") @mock.patch.object(profile, 'Profile') @mock.patch.object(connection, 'Connection') @@ -178,7 +180,8 @@ class OpenStackSDKTest(base.SenlinTestCase): mock_profile.assert_called_once_with() mock_conn.assert_called_once_with(profile=x_profile, - user_agent=sdk.USER_AGENT) + user_agent=sdk.USER_AGENT, + auth_plugin="password") mock_parse.assert_called_once_with(ex_raw) self.assertEqual(123, ex.code) self.assertEqual('BOOM', ex.message)