Fix error message if no credentials are provided

Provide meaningful error message from the scheduler
If no OpenStack credentials are provided.

Change-Id: I315a4252dc8259f6765f0a764d58fd106cd409e7
Closes-Bug: #1501384
This commit is contained in:
Saad Zaher 2015-10-01 11:38:26 +01:00
parent 25fcd746fb
commit bfb9ccd99e
1 changed files with 4 additions and 2 deletions

View File

@ -149,7 +149,8 @@ def guess_auth_version(opts):
return '3'
elif opts.os_auth_url.endswith('v2.0'):
return '2.0'
return None
raise Exception('Please provide valid keystone auth url with valid'
' keystone api version to use')
def get_auth_plugin(opts):
@ -177,7 +178,8 @@ def get_auth_plugin(opts):
return v2.Token(auth_url=opts.os_auth_url,
token=opts.os_token,
tenant_name=opts.os_tenant_name)
raise Exception('Unable to determine correct auth method')
raise Exception('Unable to determine correct auth method, please provide'
' either username or token')
class Client(object):