Skip to content

Commit

Permalink
[Fix] fixed base_path while create (#528)
Browse files Browse the repository at this point in the history
[Fix] fixed base_path while create

Fix #526

Reviewed-by: SebastianGode
Reviewed-by: Vladimir Hasko <vladimirhasko@gmail.com>
  • Loading branch information
anton-sidelnikov authored Feb 11, 2025
1 parent bf9e9a0 commit 47509ec
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion otcextensions/sdk/imsv2/v2/_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def create_image(self, **attrs):
:param dict attrs: Keyword arguments which will be used to create a
:class:`~otcextensions.sdk.imsv2.v2.image.Image`
"""
return self._create(_image.Image, **attrs)
base_path = '/cloudimages/action'
return self._create(_image.Image, base_path=base_path, **attrs)

def images(self, **attrs):
"""Retrieve a generator of images
Expand Down
5 changes: 2 additions & 3 deletions otcextensions/sdk/imsv2/v2/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,5 @@ class Image(resource.Resource):
protected = resource.Body('protected', type=bool)

def create(self, session, prepend_key=False, base_path=None):
# Overriden here to override prepend_key default value
return super(Image, self).create(session, prepend_key, base_path
+ '/action')
# Override here to override prepend_key default value
return super(Image, self).create(session, prepend_key, base_path)
2 changes: 1 addition & 1 deletion otcextensions/tests/functional/sdk/imsv2/v2/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_create_image(self):
"name": "CentOS-7-x86_64-GenericCloud.qcow2",
"description": "Create an image from a file in an OBS bucket",
"image_url":
"ims-extensions-test:CentOS-7-x86_64-GenericCloud.qcow2",
"ims-test-images:rancheros-openstack.img",
"os_version": "CentOS 7.0 64bit",
"min_disk": 40,
"image_tags": [{"key": "key2", "value": "value2"},
Expand Down

0 comments on commit 47509ec

Please sign in to comment.