diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 047e59e65..1c61eb426 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -13,11 +13,11 @@ Developer Certificate of Origin .. index:: single: license; agreement -In order to contribute to the Tacker-Horizon project, you need to adhere +In order to contribute to the openstacksdk project, you need to adhere to the `Developer Certificate of Origin`_. OpenStack utilizes the Developer Certificate of Origin (DCO) as a lightweight means to confirm that you are entitled to contribute the code you submit. This ensures that you are -providing your contributions under the project’s license and that you have +providing your contributions under the project's license and that you have the right to do so. Please read `DeveloperWorkflow`_ before sending your first patch for review. diff --git a/openstack/image/v2/_proxy.py b/openstack/image/v2/_proxy.py index 988ef1f86..004d09f0f 100644 --- a/openstack/image/v2/_proxy.py +++ b/openstack/image/v2/_proxy.py @@ -632,7 +632,9 @@ class Proxy(proxy.Proxy): self.log.debug("Image creation failed", exc_info=True) raise except Exception as e: - raise exceptions.SDKException(f"Image creation failed: {str(e)}") + raise exceptions.SDKException( + f"Image creation failed: {str(e)}" + ) from e def _make_v2_image_params(self, meta, properties): ret: dict = {} @@ -820,7 +822,7 @@ class Proxy(proxy.Proxy): raise exceptions.SDKException( f"Image creation failed: {e.message}", extra_data=glance_task, - ) + ) from e finally: # Clean up after ourselves. The object we created is not # needed after the import is done. diff --git a/openstack/tests/functional/image/v2/test_image.py b/openstack/tests/functional/image/v2/test_image.py index 7eafe828c..a5b694c66 100644 --- a/openstack/tests/functional/image/v2/test_image.py +++ b/openstack/tests/functional/image/v2/test_image.py @@ -22,6 +22,9 @@ class TestImage(base.BaseImageTest): def setUp(self): super().setUp() + with open('CONTRIBUTING.rst', 'rb') as fh: + data = fh.read() + # there's a limit on name length self.image = self.operator_cloud.image.create_image( name=TEST_IMAGE_NAME, @@ -30,7 +33,7 @@ class TestImage(base.BaseImageTest): properties={ 'description': 'This is not an image', }, - data=open('CONTRIBUTING.rst'), + data=data, ) self.assertIsInstance(self.image, _image.Image) self.assertEqual(TEST_IMAGE_NAME, self.image.name)