Change smoke test to use v3 auth for CLI

Code used to use v2 auth for CLI, now uses v3

Add roles directory to .gitignore

Change-Id: Icee0fb3e30831ea5dc986f32e20d42a6897f0dd1
This commit is contained in:
Craig Bryant 2014-11-05 11:44:00 -07:00
parent ff8d05780a
commit 4a81f11902
2 changed files with 4 additions and 5 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@
.settings .settings
*.deb *.deb
*.pyc *.pyc
roles

View File

@ -16,7 +16,7 @@ from monagent.common.keystone import Keystone
OS_USERNAME = 'mini-mon' OS_USERNAME = 'mini-mon'
OS_PASSWORD = 'password' OS_PASSWORD = 'password'
OS_TENANT_NAME = 'mini-mon' OS_TENANT_NAME = 'mini-mon'
OS_AUTH_URL = 'http://192.168.10.5:35357/' OS_AUTH_URL = 'http://192.168.10.5:35357/v3/'
def check_alarm_history(alarm_id, states): def check_alarm_history(alarm_id, states):
@ -95,8 +95,7 @@ def setup_cli():
set_if_not_env('OS_USERNAME', OS_USERNAME) set_if_not_env('OS_USERNAME', OS_USERNAME)
set_if_not_env('OS_PASSWORD', OS_PASSWORD) set_if_not_env('OS_PASSWORD', OS_PASSWORD)
set_if_not_env('OS_TENANT_NAME', OS_TENANT_NAME) set_if_not_env('OS_TENANT_NAME', OS_TENANT_NAME)
set_if_not_env('OS_AUTH_URL', OS_AUTH_URL + 'v2.0/') set_if_not_env('OS_AUTH_URL', OS_AUTH_URL)
# I don't know v2.0 is needed for CLI, but v3 if client accessed directly
set_if_not_env('MONASCA_API_URL', 'http://' + api_host + ':8080/v2.0/') set_if_not_env('MONASCA_API_URL', 'http://' + api_host + ':8080/v2.0/')
os.environ['http_proxy'] = '' os.environ['http_proxy'] = ''
os.environ['https_proxy'] = '' os.environ['https_proxy'] = ''
@ -107,9 +106,8 @@ def setup_cli():
def create_mon_client(): def create_mon_client():
api_host = get_api_host() api_host = get_api_host()
# See above comment for v3 vs v2.0
token = get_token(OS_USERNAME, OS_PASSWORD, OS_TENANT_NAME, token = get_token(OS_USERNAME, OS_PASSWORD, OS_TENANT_NAME,
OS_AUTH_URL + 'v3/') OS_AUTH_URL)
api_version = '2_0' api_version = '2_0'
endpoint = 'http://' + api_host + ':8080/v2.0' endpoint = 'http://' + api_host + ':8080/v2.0'