Merge "Memory hog during image import from glance fixed"

This commit is contained in:
Zuul 2018-02-22 20:58:47 +00:00 committed by Gerrit Code Review
commit 7f9a259d6a
2 changed files with 3 additions and 3 deletions

2
.gitignore vendored
View File

@ -27,7 +27,7 @@ pip-log.txt
.coverage
.tox
nosetests.xml
.testrepository
.stestr
.venv
# Translations

View File

@ -326,7 +326,7 @@ def _sync_glance_image_to_lxd(client, context, image_ref):
'skipping metadata injection...',
{'alias': image_ref})
with open(image_file, 'rb') as image:
image = client.images.create(image.read(), wait=True)
image = client.images.create(image, wait=True)
else:
metadata = {
'architecture': image.get(
@ -347,7 +347,7 @@ def _sync_glance_image_to_lxd(client, context, image_ref):
with open(manifest_file, 'rb') as manifest:
with open(image_file, 'rb') as image:
image = client.images.create(
image.read(), metadata=manifest.read(),
image, metadata=manifest,
wait=True)
image.add_alias(image_ref, '')