diff options
author | Luigi Toscano <ltoscano@redhat.com> | 2020-04-07 11:00:09 +0200 |
---|---|---|
committer | Luigi Toscano <ltoscano@redhat.com> | 2020-04-07 11:00:09 +0200 |
commit | 3cf5de75c19a998ffd1e264ae1380d99c833e752 (patch) | |
tree | 6bc829f8e26389453b95b4c12624ebc2f634ab33 /saharaclient | |
parent | 82ecc50fbe247ba72b0b3cfb73ff83d89390cd9d (diff) | |
download | python-saharaclient-3cf5de75c19a998ffd1e264ae1380d99c833e752.tar.gz |
Fix the "image register" command (OSC 5.2.0 regression)
python-openstackclient removed the usage of glanceclient between 5.1.0
and 5.2.0 (see: https://review.opendev.org/#/c/650374/).
As a consequence, the
openstack dataprocessing image register ...
command is now broken.
This fix means a few requirement bumps to align to OSC 5.2.0,
even though saharaclient 3.0.0 is already released.
Story: 2007501
Task: 39317
Change-Id: I377e0646303aef4984cdd6e4b6587fca9241206b
Diffstat (limited to 'saharaclient')
-rw-r--r-- | saharaclient/osc/v1/images.py | 4 | ||||
-rw-r--r-- | saharaclient/tests/unit/osc/v1/test_images.py | 4 | ||||
-rw-r--r-- | saharaclient/tests/unit/osc/v2/test_images.py | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/saharaclient/osc/v1/images.py b/saharaclient/osc/v1/images.py index 36ce753..0404a3d 100644 --- a/saharaclient/osc/v1/images.py +++ b/saharaclient/osc/v1/images.py @@ -149,8 +149,8 @@ class RegisterImage(command.ShowOne): client = self.app.client_manager.data_processing image_client = self.app.client_manager.image - image_id = osc_utils.find_resource( - image_client.images, parsed_args.image).id + image_id = image_client.find_image(parsed_args.image, + ignore_missing=False).id data = client.images.update_image( image_id, user_name=parsed_args.username, diff --git a/saharaclient/tests/unit/osc/v1/test_images.py b/saharaclient/tests/unit/osc/v1/test_images.py index 457b3f0..006a0b4 100644 --- a/saharaclient/tests/unit/osc/v1/test_images.py +++ b/saharaclient/tests/unit/osc/v1/test_images.py @@ -176,8 +176,8 @@ class TestRegisterImage(TestImages): self.image_mock.update_image.return_value = mock.Mock( image=IMAGE_INFO.copy()) self.app.client_manager.image = mock.Mock() - self.image_client = self.app.client_manager.image.images - self.image_client.get.return_value = mock.Mock(id='id') + self.image_client = self.app.client_manager.image + self.image_client.find_image.return_value = mock.Mock(id='id') # Command to test self.cmd = osc_images.RegisterImage(self.app, None) diff --git a/saharaclient/tests/unit/osc/v2/test_images.py b/saharaclient/tests/unit/osc/v2/test_images.py index 0a1669d..4e94001 100644 --- a/saharaclient/tests/unit/osc/v2/test_images.py +++ b/saharaclient/tests/unit/osc/v2/test_images.py @@ -176,8 +176,8 @@ class TestRegisterImage(TestImages): self.image_mock.update_image.return_value = mock.Mock( image=IMAGE_INFO.copy()) self.app.client_manager.image = mock.Mock() - self.image_client = self.app.client_manager.image.images - self.image_client.get.return_value = mock.Mock(id='id') + self.image_client = self.app.client_manager.image + self.image_client.find_image.return_value = mock.Mock(id='id') # Command to test self.cmd = osc_images.RegisterImage(self.app, None) |