Correct tenant_id when init python-client

Bug #1488881 reported by huangtianhua
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
huangtianhua
Kilo
Fix Released
Undecided
Angus Salkeld

Bug Description

After the change https://bugs.launchpad.net/heat/+bug/1488754 https://review.openstack.org/#/c/217050/
we can do stack-list for a tenant with chinese characters, but still can't do other operates such as stack-create, the reason details:
http://paste.openstack.org/show/428109/

Found that when we init the novaclient:
args = {
            'project_id': self.context.tenant,
            'auth_url': self.context.auth_url,
            'auth_token': self.auth_token,
            'service_type': self.COMPUTE,
            'username': None,
            'api_key': None,
            'extensions': extensions,
            'endpoint_type': endpoint_type,
            'http_log_debug': self._get_client_option('nova',
                                                      'http_log_debug'),
            'cacert': self._get_client_option('nova', 'ca_file'),
            'insecure': self._get_client_option('nova', 'insecure')
        }

the project_id we set to self.context.tenant, it's incorrect, because the self.context.tenant is the name not id of project.
Some other python-clients have the same problem.

Changed in heat:
assignee: nobody → huangtianhua (huangtianhua)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/217475

Changed in heat:
status: New → In Progress
Changed in heat:
importance: Undecided → High
milestone: none → liberty-rc1
Changed in heat:
assignee: huangtianhua (huangtianhua) → Rico Lin (rico-lin)
Rico Lin (rico-lin)
Changed in heat:
assignee: Rico Lin (rico-lin) → nobody
Changed in heat:
assignee: nobody → huangtianhua (huangtianhua)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/217475
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=17991ab22e2136a99eb6883e49352ba24d3dea8f
Submitter: Jenkins
Branch: master

commit 17991ab22e2136a99eb6883e49352ba24d3dea8f
Author: huangtianhua <email address hidden>
Date: Thu Aug 27 11:29:04 2015 +0800

    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

Changed in heat:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/224982

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (stable/kilo)

Reviewed: https://review.openstack.org/224982
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=ebc79945ec4efa8b927d6a07c8a3187ebc6ca385
Submitter: Jenkins
Branch: stable/kilo

commit ebc79945ec4efa8b927d6a07c8a3187ebc6ca385
Author: huangtianhua <email address hidden>
Date: Thu Aug 27 11:29:04 2015 +0800

    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.

    Closes-Bug: #1488881
    (cherry picked from commit 17991ab22e2136a99eb6883e49352ba24d3dea8f)

    Conflicts:
     heat/engine/clients/os/glance.py

    Change-Id: Ifc8ab70c69453344156d25aba4291769bb7fe117

Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: liberty-rc1 → 5.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.