"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "glance/async_/flows/_internal_plugins/copy_image.py" between
glance-20.0.0.tar.gz and glance-20.0.1.tar.gz

About: OpenStack Glance (Core Service: Image Service) stores and retrieves virtual machine disk images. OpenStack Compute makes use of this during instance provisioning.
The "Ussuri" series (latest release).

copy_image.py  (glance-20.0.0):copy_image.py  (glance-20.0.1)
skipping to change at line 61 skipping to change at line 61
image = self.image_repo.get(self.image_id) image = self.image_repo.get(self.image_id)
# NOTE (abhishekk): If ``all_stores_must_succeed`` is set to True # NOTE (abhishekk): If ``all_stores_must_succeed`` is set to True
# and copying task fails then we keep data in staging area as it # and copying task fails then we keep data in staging area as it
# is so that if second call is made to copy the same image then # is so that if second call is made to copy the same image then
# no need to copy the data in staging area again. # no need to copy the data in staging area again.
file_path = "%s/%s" % (getattr( file_path = "%s/%s" % (getattr(
CONF, 'os_glance_staging_store').filesystem_store_datadir, CONF, 'os_glance_staging_store').filesystem_store_datadir,
self.image_id) self.image_id)
if os.path.exists(file_path): if os.path.exists(file_path):
return file_path, 0 # NOTE (abhishekk): If previous copy-image operation is failed
# due to power failure, network failure or any other reason and
# the image data here is partial then clear the staging area and
# re-stage the fresh image data.
# Ref: https://bugs.launchpad.net/glance/+bug/1885003
size_in_staging = os.path.getsize(file_path)
if image.size == size_in_staging:
return file_path, 0
else:
LOG.debug(("Found partial image data in staging "
"%(fn)s, deleting it to re-stage "
"again"), {'fn': file_path})
try:
os.unlink(file_path)
except OSError as e:
LOG.error(_LE("Deletion of staged "
"image data from %(fn)s has failed because "
"[Errno %(en)d]"), {'fn': file_path,
'en': e.errno})
raise
# At first search image in default_backend # At first search image in default_backend
default_store = CONF.glance_store.default_backend default_store = CONF.glance_store.default_backend
for loc in image.locations: for loc in image.locations:
if loc['metadata'].get('store') == default_store: if loc['metadata'].get('store') == default_store:
try: try:
return self._copy_to_staging_store(loc) return self._copy_to_staging_store(loc)
except store_api.exceptions.NotFound: except store_api.exceptions.NotFound:
msg = (_LE("Image not present in default store, searching " msg = (_LE("Image not present in default store, searching "
"in all glance-api specific available " "in all glance-api specific available "
 End of changes. 1 change blocks. 
1 lines changed or deleted 20 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)