Skip to content

Commit 0803fd2

Browse files
psipikastephenfin
andcommitted
Make --all-stores behave the same as in glanceclient.
In order for python-openstackclient to support image imports to mutliple stores at the same time an update is needed to the --all-stores argument used by the client whereby the argument is explicitly set to contain a boolean value. This change makes the argument do what it's supposed to and do it in a way consistent with the API contract exposed by Glance. Amend tests to support the change in type of the --all-stores option. Change-Id: If5a72ca3ca68656555b5eb478e104d43f419c77e Closes-Bug: 2138903 Signed-off-by: Piotr Sipika <psipika@bloomberg.net> Co-authored-by: Stephen Finucane <stephenfin@redhat.com>
1 parent 911e643 commit 0803fd2

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

openstackclient/image/v2/image.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,6 +1719,7 @@ def get_parser(self, prog_name):
17191719
)
17201720
stores_group.add_argument(
17211721
'--all-stores',
1722+
action='store_true',
17221723
help=_(
17231724
"Make image available to all stores "
17241725
"(either '--store' or '--all-stores' required with the "

openstackclient/tests/unit/image/v2/test_image.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2085,7 +2085,7 @@ def test_import_image__glance_direct(self):
20852085
remote_image_id=None,
20862086
remote_service_interface=None,
20872087
stores=None,
2088-
all_stores=None,
2088+
all_stores=False,
20892089
all_stores_must_succeed=False,
20902090
)
20912091

@@ -2115,7 +2115,7 @@ def test_import_image__web_download(self):
21152115
remote_image_id=None,
21162116
remote_service_interface=None,
21172117
stores=None,
2118-
all_stores=None,
2118+
all_stores=False,
21192119
all_stores_must_succeed=False,
21202120
)
21212121

@@ -2253,7 +2253,7 @@ def test_import_image__copy_image(self):
22532253
remote_image_id=None,
22542254
remote_service_interface=None,
22552255
stores=['fast'],
2256-
all_stores=None,
2256+
all_stores=False,
22572257
all_stores_must_succeed=False,
22582258
)
22592259

@@ -2285,7 +2285,7 @@ def test_import_image__copy_image_disallow_failure(self):
22852285
remote_image_id=None,
22862286
remote_service_interface=None,
22872287
stores=['fast'],
2288-
all_stores=None,
2288+
all_stores=False,
22892289
all_stores_must_succeed=True,
22902290
)
22912291

@@ -2320,7 +2320,7 @@ def test_import_image__glance_download(self):
23202320
remote_image_id='remote-image-id',
23212321
remote_service_interface='private',
23222322
stores=None,
2323-
all_stores=None,
2323+
all_stores=False,
23242324
all_stores_must_succeed=False,
23252325
)
23262326

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
fixes:
3+
- |
4+
The ``--all-stores`` of the ``image import`` command is now correctly
5+
treated as a boolean flag.

0 commit comments

Comments
 (0)