IP Address Showing as JSON in Show Command

changes the 'ip' value returned in trove-show from a json array to
a string of comma separated values

before:

+----------+--------------------------------------+
| Property |                Value                 |
+----------+--------------------------------------+
| created  |         2013-10-23T06:49:55          |
|  flavor  |                  9                   |
|    id    | 95f6bc02-0d84-46e1-83e6-db7f3f064677 |
|    ip    |            [u'10.0.0.2']             |
|   name   |               TestTest               |
|  status  |                ACTIVE                |
| updated  |         2013-10-23T06:49:58          |
|  volume  |                  5                   |
+----------+--------------------------------------+

after:

+----------+--------------------------------------+
| Property |                Value                 |
+----------+--------------------------------------+
| created  |         2013-10-23T06:49:55          |
|  flavor  |                  9                   |
|    id    | 95f6bc02-0d84-46e1-83e6-db7f3f064677 |
|    ip    |               10.0.0.2               |
|   name   |               TestTest               |
|  status  |                ACTIVE                |
| updated  |         2013-10-23T06:49:58          |
|  volume  |                  5                   |
+----------+--------------------------------------+

Change-Id: I56f2a6dea90dcfa790abb8592f565372ad616a1b
Closes-Bug: 1245608
This commit is contained in:
amcrn
2013-10-28 11:24:13 -07:00
parent d06fadd876
commit 737dcf2ef6

View File

@@ -117,7 +117,8 @@ def do_show(cs, args):
instance._info['flavor'] = instance.flavor['id'] instance._info['flavor'] = instance.flavor['id']
if hasattr(instance, 'volume'): if hasattr(instance, 'volume'):
instance._info['volume'] = instance.volume['size'] instance._info['volume'] = instance.volume['size']
if hasattr(instance, 'ip'):
instance._info['ip'] = ', '.join(instance.ip)
_print_instance(instance) _print_instance(instance)