Set correct tenant id when python-client init

If tenant name with chinese characters, an
'UnicodeEncodeError' exception raised when the tenant
creating a stack with a nova server. To set correct
tenant id instead of tenant name when novaclient init
is the best way to avoid this problem.

Also this patch fix this problem for glanceclient and
cinderclient.

Change-Id: Ifc8ab70c69453344156d25aba4291769bb7fe117
Closes-Bug: #1488881
This commit is contained in:
huangtianhua 2015-08-27 11:29:04 +08:00 committed by Rico Lin
parent 2314ed85c2
commit 17991ab22e
3 changed files with 3 additions and 3 deletions

View File

@ -70,7 +70,7 @@ class CinderClientPlugin(client_plugin.ClientPlugin):
args = {
'service_type': service_type,
'auth_url': con.auth_url or '',
'project_id': con.tenant,
'project_id': con.tenant_id,
'username': None,
'api_key': None,
'endpoint_type': endpoint_type,

View File

@ -40,7 +40,7 @@ class GlanceClientPlugin(client_plugin.ClientPlugin):
args = {
'auth_url': con.auth_url,
'service_type': self.IMAGE,
'project_id': con.tenant,
'project_id': con.tenant_id,
'token': self.auth_token,
'endpoint_type': endpoint_type,
'cacert': self._get_client_option('glance', 'ca_file'),

View File

@ -66,7 +66,7 @@ class NovaClientPlugin(client_plugin.ClientPlugin):
extensions = nc.discover_extensions(NOVACLIENT_VERSION)
args = {
'project_id': self.context.tenant,
'project_id': self.context.tenant_id,
'auth_url': self.context.auth_url,
'auth_token': self.auth_token,
'service_type': self.COMPUTE,