1
0
mirror of https://github.com/lxc/pylxd.git synced 2026-02-05 15:45:44 +01:00

Drop wait argument from image create (#622)

This removes a useless parameter that was supposed to be removed on 2.3
release.
This commit is contained in:
Simon Deziel
2025-01-09 13:59:24 -05:00
committed by GitHub
4 changed files with 6 additions and 8 deletions

View File

@@ -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)` -

View File

@@ -49,7 +49,7 @@ class TestImages(IntegrationTestCase):
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)

View File

@@ -116,7 +116,7 @@ class Image(model.Model):
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,
)

View File

@@ -109,7 +109,7 @@ class TestImage(testing.PyLXDTestCase):
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 @@ class TestImage(testing.PyLXDTestCase):
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 @@ class TestImage(testing.PyLXDTestCase):
"""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)