From a56aeb45416bad4deaa19e5c81611cf462520454 Mon Sep 17 00:00:00 2001 From: hamistao Date: Thu, 9 Jan 2025 00:06:55 -0300 Subject: [PATCH 1/4] pylxd/models/image: Update `wait` parameter deprecation warning Signed-off-by: hamistao --- pylxd/models/image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylxd/models/image.py b/pylxd/models/image.py index 53d33662..c016a34f 100644 --- a/pylxd/models/image.py +++ b/pylxd/models/image.py @@ -113,7 +113,7 @@ def create( if wait is False: # pragma: no cover warnings.warn( - "Image.create wait parameter ignored and will be removed in " "2.3", + "Image.create wait parameter ignored and will be removed", DeprecationWarning, ) From 06ddb263c2212904fcb5d63d1e1ac7923b8b4170 Mon Sep 17 00:00:00 2001 From: hamistao Date: Thu, 9 Jan 2025 00:08:44 -0300 Subject: [PATCH 2/4] doc/source/images: Drop `wait` argument from docs Signed-off-by: hamistao --- doc/source/images.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/images.rst b/doc/source/images.rst index cfa40d58..5a6a2136 100644 --- a/doc/source/images.rst +++ b/doc/source/images.rst @@ -19,7 +19,7 @@ methods: And create through the following methods, there's also a copy method on an image: - - `create(data, public=False, wait=True)` - Create a new image. The first + - `create(data, public=False)` - Create a new image. The first argument is the binary data of the image itself. If the image is public, set `public` to `True`. - `create_from_simplestreams(server, alias, public=False, auto_update=False, wait=False)` - From 2e3d299b600db443deed3adb8b5af7f273f0f6fc Mon Sep 17 00:00:00 2001 From: hamistao Date: Thu, 9 Jan 2025 00:11:19 -0300 Subject: [PATCH 3/4] pylxd/models/tests: Drop `wait` argument from tests Signed-off-by: hamistao --- pylxd/models/tests/test_image.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pylxd/models/tests/test_image.py b/pylxd/models/tests/test_image.py index 8696e65d..063eedf8 100644 --- a/pylxd/models/tests/test_image.py +++ b/pylxd/models/tests/test_image.py @@ -109,7 +109,7 @@ def test_all(self): def test_create(self): """An image is created.""" fingerprint = hashlib.sha256(b"").hexdigest() - a_image = models.Image.create(self.client, b"", public=True, wait=True) + a_image = models.Image.create(self.client, b"", public=True) self.assertIsInstance(a_image, models.Image) self.assertEqual(fingerprint, a_image.fingerprint) @@ -117,9 +117,7 @@ def test_create(self): def test_create_with_metadata(self): """An image with metadata is created.""" fingerprint = hashlib.sha256(b"").hexdigest() - a_image = models.Image.create( - self.client, b"", metadata=b"", public=True, wait=True - ) + a_image = models.Image.create(self.client, b"", metadata=b"", public=True) self.assertIsInstance(a_image, models.Image) self.assertEqual(fingerprint, a_image.fingerprint) @@ -128,7 +126,7 @@ def test_create_with_metadata_streamed(self): """An image with metadata is created.""" fingerprint = hashlib.sha256(b"").hexdigest() a_image = models.Image.create( - self.client, StringIO(""), metadata=StringIO(""), public=True, wait=True + self.client, StringIO(""), metadata=StringIO(""), public=True ) self.assertIsInstance(a_image, models.Image) From 6f56d4562fefd08aa4765ab1c1d557738e5ea852 Mon Sep 17 00:00:00 2001 From: hamistao Date: Thu, 9 Jan 2025 00:19:54 -0300 Subject: [PATCH 4/4] integration: Drop `wait` parameter from integration tests Signed-off-by: hamistao --- integration/test_images.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration/test_images.py b/integration/test_images.py index 2c1991ce..9674bbdd 100644 --- a/integration/test_images.py +++ b/integration/test_images.py @@ -49,7 +49,7 @@ def test_create(self): with open(path, "rb") as f: data = f.read() - image = self.client.images.create(data, wait=True) + image = self.client.images.create(data) self.assertEqual(fingerprint, image.fingerprint)