This commit is contained in:
Sandy Walsh 2011-11-09 04:35:39 -08:00
parent f513bdccc5
commit c386221bd8
3 changed files with 17 additions and 17 deletions

View File

@ -62,9 +62,9 @@ class OpenStackComputeShell(object):
default=env('NOVA_USERNAME'),
help='Defaults to env[NOVA_USERNAME].')
parser.add_argument('--apikey',
default=env('NOVA_API_KEY'),
help='Defaults to env[NOVA_API_KEY].')
parser.add_argument('--password',
default=env('NOVA_PASSWORD'),
help='Defaults to env[NOVA_PASSWORD].')
parser.add_argument('--projectid',
default=env('NOVA_PROJECT_ID'),
@ -153,21 +153,21 @@ class OpenStackComputeShell(object):
self.do_help(args)
return 0
user, apikey, projectid, url, region_name, insecure = \
args.username, args.apikey, args.projectid, args.url, \
user, password, projectid, url, region_name, insecure = \
args.username, args.password, args.projectid, args.url, \
args.region_name, args.insecure
#FIXME(usrleon): Here should be restrict for project id same as
# for username or apikey but for compatibility it is not.
# for username or password but for compatibility it is not.
if not user:
raise exc.CommandError("You must provide a username, either"
"via --username or via "
"env[NOVA_USERNAME]")
if not apikey:
raise exc.CommandError("You must provide an API key, either"
"via --apikey or via"
"env[NOVA_API_KEY]")
if not password:
raise exc.CommandError("You must provide a password, either"
"via --password or via"
"env[NOVA_PASSWORD]")
if options.version and options.version != '1.0':
if not projectid:
raise exc.CommandError("You must provide an projectid, either"
@ -179,7 +179,7 @@ class OpenStackComputeShell(object):
"via --url or via"
"env[NOVA_URL")
self.cs = self.get_api_class(options.version)(user, apikey, projectid,
self.cs = self.get_api_class(options.version)(user, password, projectid,
url, insecure, region_name=region_name)
try:

View File

@ -14,7 +14,7 @@ class Client(object):
Create an instance with your creds::
>>> client = Client(USERNAME, API_KEY, PROJECT_ID, AUTH_URL)
>>> client = Client(USERNAME, PASSWORD, PROJECT_ID, AUTH_URL)
Then call methods on its managers::
@ -25,7 +25,7 @@ class Client(object):
"""
def __init__(self, username, api_key, project_id, auth_url=None,
def __init__(self, username, password, project_id, auth_url=None,
insecure=False, timeout=None, token=None, region_name=None):
self.accounts = accounts.AccountManager(self)
@ -39,7 +39,7 @@ class Client(object):
_auth_url = auth_url or 'https://auth.api.rackspacecloud.com/v1.0'
self.client = client.HTTPClient(username,
api_key,
password,
project_id,
_auth_url,
insecure=insecure,

View File

@ -17,7 +17,7 @@ class Client(object):
Create an instance with your creds::
>>> client = Client(USERNAME, API_KEY, PROJECT_ID, AUTH_URL)
>>> client = Client(USERNAME, PASSWORD, PROJECT_ID, AUTH_URL)
Then call methods on its managers::
@ -29,7 +29,7 @@ class Client(object):
"""
# FIXME(jesse): project_id isn't required to autenticate
def __init__(self, username, api_key, project_id, auth_url,
def __init__(self, username, password, project_id, auth_url,
insecure=False, timeout=None, token=None, region_name=None):
self.flavors = flavors.FlavorManager(self)
self.floating_ips = floating_ips.FloatingIPManager(self)
@ -46,7 +46,7 @@ class Client(object):
security_group_rules.SecurityGroupRuleManager(self)
self.client = client.HTTPClient(username,
api_key,
password,
project_id,
auth_url,
insecure=insecure,