Bug 1689342 - OpenStack CLI produces exception when trying to restore volume backup
Summary: OpenStack CLI produces exception when trying to restore volume backup
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-openstackclient
Version: 14.0 (Rocky)
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Sofia Enriquez
QA Contact: Filip Hubík
URL:
Whiteboard:
: 1693341 1694742 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-15 16:42 UTC by Filip Hubík
Modified: 2019-11-06 16:53 UTC (History)
10 users (show)

Fixed In Version: python-openstackclient-3.16.2-3.el7ost
Doc Type: Bug Fix
Doc Text:
Previously, the 'openstack volume backup restore' command would return "'VolumeBackupRestore' object is not iterable", even though the operation was completed successfully. This patch ensures that the VolumeBackupRestore object attribute '_info' is returned, instead of the VolumeBackupsRestore object, so that the error is not returned.
Clone Of:
Environment:
Last Closed: 2019-11-06 16:53:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
output of "openstack volume ... --verbose --debug" (41.38 KB, text/plain)
2019-03-15 16:42 UTC, Filip Hubík
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1733315 0 None None None 2019-04-02 19:01:34 UTC
OpenStack gerrit 660746 0 None None None 2019-05-22 15:01:06 UTC
Red Hat Product Errata RHBA-2019:3747 0 None None None 2019-11-06 16:53:41 UTC

Description Filip Hubík 2019-03-15 16:42:51 UTC
Created attachment 1544543 [details]
output of "openstack volume ... --verbose --debug"

Description of problem:
On deployed OSP14 overcloud it is not possible to restore volume backup using standardized python2-openstaclient's interface, it is possible only using python-cinder's one.

(overcloud) [stack@undercloud-0 ~]$ openstack image list
+--------------------------------------+--------------------------------------------------------+--------+
| ID                                   | Name                                                   | Status |
+--------------------------------------+--------------------------------------------------------+--------+
| c05d0150-c881-4cae-a60f-d7a9635f0222 | cirros-0.3.5-x86_64-disk.img                           | active |
| 93a1f193-b2e3-435d-a8d8-fc4501eb8d1e | cirros-0.3.5-x86_64-disk.img_alt                       | active |
+--------------------------------------+--------------------------------------------------------+--------+
$ openstack volume create test --image cirros-0.3.5-x86_64-disk.img --size 1
$ openstack volume backup create test --name backup_test
$ openstack volume backup restore backup_test test
'VolumeBackupsRestore' object is not iterable
$ echo $?
1

# In depth "openstack volume backup restore backup_test test --verbose --debug" ends with
...
RESP BODY: {"restore": {"backup_id": "e5442d2e-fe71-4365-8f28-a650c7339f9b", "volume_name": "test2", "volume_id": "7bd88087-1608-49ff-a668-731277e67a0c"}}
POST call to volumev3 for http://10.0.0.113:8776/v3/223d15715dd24bd2ac9a52795379f3b7/backups/e5442d2e-fe71-4365-8f28-a650c7339f9b/restore used request id req-496e2897-1ed7-43be-9444-84d50803ac18
'VolumeBackupsRestore' object is not iterable
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 402, in run_subcommand
    result = cmd.run(parsed_args)
  File "/usr/lib/python2.7/site-packages/osc_lib/command/command.py", line 41, in run
    return super(Command, self).run(parsed_args)
  File "/usr/lib/python2.7/site-packages/cliff/display.py", line 116, in run
    column_names, data = self.take_action(parsed_args)
TypeError: 'VolumeBackupsRestore' object is not iterable
clean_up RestoreVolumeBackup: 'VolumeBackupsRestore' object is not iterable
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/osc_lib/shell.py", line 135, in run
    ret_val = super(OpenStackShell, self).run(argv)
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 281, in run
    result = self.run_subcommand(remainder)
  File "/usr/lib/python2.7/site-packages/osc_lib/shell.py", line 175, in run_subcommand
    ret_value = super(OpenStackShell, self).run_subcommand(argv)
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 402, in run_subcommand
    result = cmd.run(parsed_args)
  File "/usr/lib/python2.7/site-packages/osc_lib/command/command.py", line 41, in run
    return super(Command, self).run(parsed_args)
  File "/usr/lib/python2.7/site-packages/cliff/display.py", line 116, in run
    column_names, data = self.take_action(parsed_args)
TypeError: 'VolumeBackupsRestore' object is not iterable

END return value: 1

# but on the other hand, using the old cinder CLI:

$ cinder backup-restore --volume test backup_test
+-------------+--------------------------------------+
| Property    | Value                                |
+-------------+--------------------------------------+
| backup_id   | e5442d2e-fe71-4365-8f28-a650c7339f9b |
| volume_id   | 7bd88087-1608-49ff-a668-731277e67a0c |
| volume_name | test                                 |
+-------------+--------------------------------------+
(overcloud) [stack@undercloud-0 ~]$ echo $?
0

Version-Release number of selected component (if applicable):
OSP14

How reproducible:
Always

Steps to Reproduce:
1. Deploy OSP14 topology 1uc,3contr,2comp,3ceph using Infrared
2. Access stack@undercloud, source ~/overcloudrc
3. Perform above

Additional info:
python2-openstackclient-3.16.2-1.el7ost.noarch

Comment 1 Filip Hubík 2019-03-15 16:43:47 UTC
It looks like we might be missing changes around https://review.openstack.org/#/c/624860 .

Comment 2 Steve Linabery 2019-03-15 17:20:34 UTC
(In reply to Filip Hubík from comment #1)
> It looks like we might be missing changes around
> https://review.openstack.org/#/c/624860 .

Yes, osp14 has python-openstackclient-3.16.2-1.el7ost in 14z1. 624860 will have to be backported upstream to stable/rocky if that's the only missing piece.

Comment 4 Alan Bishop 2019-04-02 19:02:03 UTC
*** Bug 1693341 has been marked as a duplicate of this bug. ***

Comment 5 Alan Bishop 2019-04-02 19:02:14 UTC
*** Bug 1694742 has been marked as a duplicate of this bug. ***

Comment 8 Alan Bishop 2019-05-22 18:59:44 UTC
Apparently this is an old issue that only got attention upstream in stein. Fortunately there is a workaround, as reported in bug #1464138 comment #5.

Comment 13 Tzach Shefi 2019-10-02 05:00:07 UTC
Insufficient fixed-in to verify, waiting for newer build. 

14  -p 2019-09-06.1
python-openstackclient-lang-3.16.2-2.el7ost.noarch < fixed-in

Comment 15 errata-xmlrpc 2019-11-06 16:53:25 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:3747


Note You need to log in before you can comment on or make changes to this bug.