Client fails with global name '_' is not defined error when env[OS_USERNAME] is not exported

Bug #1355252 reported by Michal Dulko
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Glance Client
Fix Released
Undecided
Michal Dulko

Bug Description

Due to latest changes to support Keystone v3 API client produces strange error when environment variables with OpenStack credentials are not exported:

mdulko@gklab-044-100:~/devstack$ glance image-list
global name '_' is not defined
mdulko@gklab-044-100:~/devstack$ source openrc
mdulko@gklab-044-100:~/devstack$ glance image-list
+----+------+-------------+------------------+------+--------+
| ID | Name | Disk Format | Container Format | Size | Status |
+----+------+-------------+------------------+------+--------+
+----+------+-------------+------------------+------+--------+

Changed in python-glanceclient:
assignee: nobody → Michal Dulko (michal-dulko-f)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-glanceclient (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (master)

Reviewed: https://review.openstack.org/115236
Committed: https://git.openstack.org/cgit/openstack/python-glanceclient/commit/?id=d97f03e09960a7ee28e2044e0cdc799d1763c54e
Submitter: Jenkins
Branch: master

commit d97f03e09960a7ee28e2044e0cdc799d1763c54e
Author: Matthew Booth <email address hidden>
Date: Tue Aug 19 11:31:17 2014 +0100

    Import missing gettextutils._ in shell.py

    Closes-Bug: #1355252

    Change-Id: I3aef19235735b3b374b92985f142712cb0f37a35

Changed in python-glanceclient:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on python-glanceclient (master)

Change abandoned by Michal Dulko (<email address hidden>) on branch: master
Review: https://review.openstack.org/113289

Louis Taylor (kragniz)
Changed in python-glanceclient:
status: Fix Committed → Fix Released
Revision history for this message
kunthar (kunthar) wrote :

As of Dec 24 2014 i have same issue.
If OS env vars not set i have the same error.
You can get rid of it by sourcing the env file.

glancerc
export OS_TENANT_NAME=service
export OS_USERNAME=glance
export OS_PASSWORD=pass
export OS_AUTH_URL=http://controller:5000/v2.0

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (master)

Reviewed: https://review.openstack.org/116894
Committed: https://git.openstack.org/cgit/openstack/python-glanceclient/commit/?id=b47925eda1a674ee2497ec627eee089fbd6e1ac0
Submitter: Jenkins
Branch: master

commit b47925eda1a674ee2497ec627eee089fbd6e1ac0
Author: Michal Dulko <email address hidden>
Date: Mon Feb 9 14:32:17 2015 +0100

    Unit tests covering missing username or password

    After fixing message displayed when client is executed without
    required environment variables exported (OS_USERNAME, OS_PASSWORD,
    OS_PROJECT_NAME, OS_AUTH_URL) regression tests should be added. I've
    also fixed an issue causing tests using make_env method to always use
    FAKE_V2_ENV, even in ShellTestWithKeystoneV3Auth.

    Change-Id: I800c8fa11ee45d19f179bd030426db86a93d9f6a
    Closes-Bug: 1419788
    Partial-Bug: 1355252

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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