Comment 7 for bug 1733315

Revision history for this message
Rajat Dhasmana (whoami-rajat) wrote :

So after digging into the matter i found out that cliff expects a list with two tuples (columns and its respective data) to display in a tabular format whereas the restore class returned VolumeBackupsRetore object as to what sean explained.

VolumeBackupsRetore object contains _info field which should be returned instead of the object

{'_checksum': None,
 '_info': {u'backup_id': u'c6c37982-b470-4e50-84d7-a0fbdd58c6f0',
           u'volume_id': u'27b5a87f-4fb6-4bab-8d2e-8ada838e1736',
           u'volume_name': u'new_vol'},
 '_loaded': False,
 'backup_id': u'c6c37982-b470-4e50-84d7-a0fbdd58c6f0',
 'manager': <cinderclient.v2.volume_backups_restore.VolumeBackupRestoreManager object at 0x7fbe47875590>,
 'volume_id': u'27b5a87f-4fb6-4bab-8d2e-8ada838e1736',
 'volume_name': u'new_vol',
 'x_openstack_request_ids': ['req-557fa5bf-0c4c-4938-8d78-f00ec3684865']}

This is the return value format expected by cliff,

[(u'backup_id', u'volume_id', u'volume_name'), (u'c6c37982-b470-4e50-84d7-a0fbdd58c6f0', u'27b5a87f-4fb6-4bab-8d2e-8ada838e1736', u'new_vol')]