useless 'u' in the return info of "openstack aggregate show"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Invalid
|
Undecided
|
Unassigned | ||
python-novaclient |
Invalid
|
Low
|
Pushkar | ||
python-openstackclient |
Triaged
|
Undecided
|
Unassigned |
Bug Description
[Summary]
useless 'u' in the return info of "openstack aggregate show"
[Topo]
devstack all-in-one node
[Description and expect result]
no useless 'u' in the return info of "openstack aggregate show"
[Reproduceable or not]
reproduceable
[Recreate Steps]
1) useless 'u' for metadata when creating an aggregate:
root@45-
--zone bbb --property abc=1 agg3
+------
| Field | Value |
+------
| availability_zone | bbb |
| created_at | 2016-01-
| deleted | False |
| deleted_at | None |
| hosts | [] |
| id | 3 |
| metadata | {u'abc': u'1', u'availability_
| name | agg3 |
| updated_at | None |
+------
root@45-
2)useless 'u' for properties when show an aggregate:
root@45-
+------
| Field | Value |
+------
| availability_zone | bbb |
| created_at | 2016-01-
| deleted | False |
| deleted_at | None |
| hosts | [] |
| id | 3 |
| name | agg3 |
| properties | {u'abc': u'1'} |
| updated_at | None |
+------
root@45-
3)useless 'u' for hosts when add host into an aggregate:
root@45-59:~# openstack aggregate add host agg3 45-59
+------
| Field | Value |
+------
| availability_zone | bbb |
| created_at | 2016-01-
| deleted | False |
| deleted_at | None |
| hosts | [u'45-59'] |
| id | 3 |
| metadata | {u'abc': u'1', u'availability_
| name | agg3 |
| updated_at | None |
+------
root@45-59:~#
[Configration]
reproduceable bug, no need
[logs]
reproduceable bug, no need
[Root cause anlyze or debug inf]
reproduceable bug
[Attachment]
None
Changed in nova: | |
assignee: | nobody → Pallavi (p-pallavi) |
Changed in nova: | |
status: | New → Confirmed |
tags: | added: api |
Changed in python-novaclient: | |
assignee: | nobody → Pushkar (push7joshi) |
Changed in python-novaclient: | |
status: | Triaged → Invalid |
Changed in python-openstackclient: | |
assignee: | nobody → Pushkar (push7joshi) |
Changed in python-openstackclient: | |
status: | Confirmed → In Progress |
Changed in nova: | |
assignee: | Pallavi (p-pallavi) → nobody |
Hi,
I reproduced the bug as mentioned above and could see the 'u' in the output. On debugging, i find that while printing the aggregate data, if the value is a dict or list, it needs to be converted into Json format str.
I made the below change in the file /usr/local/ lib/python2. 7/dist- packages/ cliff/formatter s/table. py such that if the value is dict or list then it is properly formatted and gets printed in the output.
if isinstance(value, (dict, list)): dumps(value)
value = jsonutils.
Kindly let me know your comments on this.
Thanks & Regards,
Pallavi.