From fff4a1cd23057160af13f157a6fde2c172fae7a9 Mon Sep 17 00:00:00 2001 From: Steve Martinelli Date: Fri, 16 Jan 2015 02:20:52 -0500 Subject: Add helpful messages when authN'ing with password Setting up auth options can be complicated, and we currently don't do any checking before we build all our auth parameters to send off to keystoneclient. We should do some basic checking to guide new users. Change-Id: I9c88f1c9637b3870c151952ecc797aaf65be271a Closes-Bug: #1400531 --- openstackclient/tests/common/test_clientmanager.py | 7 +++++-- openstackclient/tests/fakes.py | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'openstackclient/tests') diff --git a/openstackclient/tests/common/test_clientmanager.py b/openstackclient/tests/common/test_clientmanager.py index 8c27e562..2c213f8a 100644 --- a/openstackclient/tests/common/test_clientmanager.py +++ b/openstackclient/tests/common/test_clientmanager.py @@ -126,7 +126,8 @@ class TestClientManager(utils.TestCase): client_manager = clientmanager.ClientManager( auth_options=FakeOptions(os_auth_url=fakes.AUTH_URL, os_username=fakes.USERNAME, - os_password=fakes.PASSWORD), + os_password=fakes.PASSWORD, + os_project_name=fakes.PROJECT_NAME), api_version=API_VERSION, verify=False, ) @@ -183,6 +184,7 @@ class TestClientManager(utils.TestCase): auth_options=FakeOptions(os_auth_url=fakes.AUTH_URL, os_username=fakes.USERNAME, os_password=fakes.PASSWORD, + os_project_name=fakes.PROJECT_NAME, os_auth_type='v2password'), api_version=API_VERSION, verify='cafile', @@ -218,7 +220,8 @@ class TestClientManager(utils.TestCase): # test password auth params = dict(os_auth_url=fakes.AUTH_URL, os_username=fakes.USERNAME, - os_password=fakes.PASSWORD) + os_password=fakes.PASSWORD, + os_project_name=fakes.PROJECT_NAME) self._select_auth_plugin(params, '2.0', 'v2password') self._select_auth_plugin(params, '3', 'v3password') self._select_auth_plugin(params, 'XXX', 'password') diff --git a/openstackclient/tests/fakes.py b/openstackclient/tests/fakes.py index e25751d6..d37555e3 100644 --- a/openstackclient/tests/fakes.py +++ b/openstackclient/tests/fakes.py @@ -25,6 +25,7 @@ AUTH_TOKEN = "foobar" AUTH_URL = "http://0.0.0.0" USERNAME = "itchy" PASSWORD = "scratchy" +PROJECT_NAME = "poochie" TEST_RESPONSE_DICT = fixture.V2Token(token_id=AUTH_TOKEN, user_name=USERNAME) -- cgit v1.2.1