summaryrefslogtreecommitdiff
path: root/heatclient/shell.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-11-28 08:58:52 +0000
committerGerrit Code Review <review@openstack.org>2013-11-28 08:58:52 +0000
commitafa6b7fa6a47d5a29df234d8de0ef461263edc7c (patch)
tree47226dba44bb3605a61260d51db6c23efb8fa8d6 /heatclient/shell.py
parenta46657a3e088f1596d8592cd8a7a4c5a54e5632b (diff)
parent2706b48159e8937b4ef266f194a158ba60e2f36d (diff)
downloadpython-heatclient-afa6b7fa6a47d5a29df234d8de0ef461263edc7c.tar.gz
Merge "Make tokens work with --os-no-client-auth"
Diffstat (limited to 'heatclient/shell.py')
-rw-r--r--heatclient/shell.py34
1 files changed, 20 insertions, 14 deletions
diff --git a/heatclient/shell.py b/heatclient/shell.py
index b254964..7d7fb39 100644
--- a/heatclient/shell.py
+++ b/heatclient/shell.py
@@ -299,20 +299,26 @@ class HeatShell(object):
" or a token via --os-auth-token or"
" env[OS_AUTH_TOKEN]")
- if not (args.os_tenant_id or args.os_tenant_name):
- raise exc.CommandError("You must provide a tenant_id via"
- " either --os-tenant-id or via"
- " env[OS_TENANT_ID]")
-
- if not args.os_auth_url:
- raise exc.CommandError("You must provide an auth url via"
- " either --os-auth-url or via "
- "env[OS_AUTH_URL]")
- if args.os_no_client_auth and not args.heat_url:
- raise exc.CommandError("If you specify --os-no-client-auth"
- " you must also specify a Heat API URL "
- "via either --heat-url or "
- "env[HEAT_URL]")
+ if args.os_no_client_auth:
+ if not args.heat_url:
+ raise exc.CommandError("If you specify --os-no-client-auth"
+ " you must also specify a Heat API URL"
+ " via either --heat-url or"
+ " env[HEAT_URL]")
+ else:
+ # Tenant name or ID is needed to make keystoneclient retrieve a
+ # service catalog, it's not required if os_no_client_auth is
+ # specified, neither is the auth URL
+ if not (args.os_tenant_id or args.os_tenant_name):
+ raise exc.CommandError("You must provide a tenant_id via"
+ " either --os-tenant-id or via"
+ " env[OS_TENANT_ID]")
+
+ if not args.os_auth_url:
+ raise exc.CommandError("You must provide an auth url via"
+ " either --os-auth-url or via"
+ " env[OS_AUTH_URL]")
+
kwargs = {
'username': args.os_username,
'password': args.os_password,