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:
parent
2314ed85c2
commit
17991ab22e
@ -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,
|
||||
|
@ -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'),
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user