python-keystone client fails w/ PrettyTable 0.5-3 (

Bug #1019409 reported by Dan Prince
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
High
Dan Prince

Bug Description

When using Git Hash 3813abcf20fa5451c2df8b1b3f252e6b5a3bf6f4 or later of python-keystoneclient on Fedora 17 I'm seeing the following issue with prettytable when trying to run keystone commands:

[root@nova1 ~]# keystone --debug tenant-create --name=zz
connect: (localhost, 35357)
send: 'POST /v2.0/tenants HTTP/1.1\r\nHost: localhost:35357\r\nContent-Length: 64\r\nx-auth-token: ADMIN\r\ncontent-type: application/json\r\naccept-encoding: gzip, deflate\r\nuser-agent: python-keystoneclient\r\n\r\n{"tenant": {"enabled": true, "name": "zz", "description": null}}'
reply: 'HTTP/1.1 200 OK\r\n'
header: Content-Type: application/json
header: Vary: X-Auth-Token
header: Date: Fri, 29 Jun 2012 20:16:53 GMT
header: Transfer-Encoding: chunked
Traceback (most recent call last):
  File "/bin/keystone", line 9, in <module>
    load_entry_point('python-keystoneclient==9999.9', 'console_scripts', 'keystone')()
  File "/usr/lib/python2.7/site-packages/keystoneclient/shell.py", line 294, in main
    OpenStackIdentityShell().main(sys.argv[1:])
  File "/usr/lib/python2.7/site-packages/keystoneclient/shell.py", line 254, in main
    args.func(self.cs, args)
  File "/usr/lib/python2.7/site-packages/keystoneclient/v2_0/shell.py", line 123, in do_tenant_create
    utils.print_dict(tenant._info)
  File "/usr/lib/python2.7/site-packages/keystoneclient/utils.py", line 49, in print_dict
    print pt.get_string(sortby='Property')
  File "/usr/lib/python2.7/site-packages/prettytable.py", line 336, in get_string
    rows = self._get_sorted_rows(start, end, sortby, reversesort)
  File "/usr/lib/python2.7/site-packages/prettytable.py", line 261, in _get_sorted_rows
    rows = [[row[sortindex]]+row for row in rows]
TypeError: can only concatenate list (not "tuple") to list

Dan Prince (dan-prince)
Changed in keystone:
assignee: nobody → Dan Prince (dan-prince)
importance: Undecided → High
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-keystoneclient (master)

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

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

Reviewed: https://review.openstack.org/9187
Committed: http://github.com/openstack/python-keystoneclient/commit/11258a06c21c8240820c6e14b3e44a92120d5889
Submitter: Jenkins
Branch: master

commit 11258a06c21c8240820c6e14b3e44a92120d5889
Author: Dan Prince <email address hidden>
Date: Fri Jun 29 16:27:25 2012 -0400

    Don't call PrettyTable add_row with a tuple.

    Updates the print_dict function in utils.py so that it doesn't
    try to append a tuple with add_row. According to pydoc add_row
    should get passed a list (not a tuple):

      Arguments:

        row - row of data, should be a list with as many elements as
        the table has fields

    This fixes a TypeError which can occur with the existing code:

    TypeError: can only concatenate list (not "tuple") to list

    Fixes LP Bug #1019409.

    Change-Id: I16f745afa872106c3bc44c33d88db2a5aacd776c

Changed in keystone:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in keystone:
milestone: none → folsom-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: folsom-2 → 2012.2
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.