Adds clarification note for project_id vs tenant_id

The client __init__ method takes both a project_id and tenant_id which is
rather confusing as in the Nova API these terms are used interchangeably. The
comment clarifies the difference between a project_id and tenant_id
when using novaclient.

For backwards compatibility reasons we can't really change the names (though for V3
perhaps we should in the future).

Change-Id: I569fe9318335c8d686153b0936205cb190e01ef1
This commit is contained in:
Chris Yeoh 2014-03-17 15:12:01 +10:30
parent 5a3ca61cfd
commit 6aa419b82e
2 changed files with 13 additions and 0 deletions

View File

@ -92,6 +92,13 @@ class Client(object):
connection_pool=False, completion_cache=None):
# FIXME(comstud): Rename the api_key argument above when we
# know it's not being used as keyword argument
# NOTE(cyeoh): In the novaclient context (unlike Nova) the
# project_id is not the same as the tenant_id. Here project_id
# is a name (what the Nova API often refers to as a project or
# tenant name) and tenant_id is a UUID (what the Nova API
# often refers to as a project_id or tenant_id).
password = api_key
self.projectid = project_id
self.tenant_id = tenant_id

View File

@ -75,6 +75,12 @@ class Client(object):
auth_plugin=None, auth_token=None,
cacert=None, tenant_id=None, user_id=None,
connection_pool=False, completion_cache=None):
# NOTE(cyeoh): In the novaclient context (unlike Nova) the
# project_id is not the same as the tenant_id. Here project_id
# is a name (what the Nova API often refers to as a project or
# tenant name) and tenant_id is a UUID (what the Nova API
# often refers to as a project_id or tenant_id).
self.projectid = project_id
self.tenant_id = tenant_id
self.user_id = user_id