"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "glance/common/store_utils.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).

store_utils.py  (glance-20.0.0):store_utils.py  (glance-20.0.1)
skipping to change at line 176 skipping to change at line 176
if url_prefix and uri.startswith(url_prefix): if url_prefix and uri.startswith(url_prefix):
url_matched = True url_matched = True
break break
if url_matched: if url_matched:
return u"%s" % store return u"%s" % store
else: else:
LOG.warning("Invalid location uri %s", uri) LOG.warning("Invalid location uri %s", uri)
return return
def update_store_in_locations(locations, image_id): def update_store_in_locations(image, image_repo):
for loc in image.locations:
if (not loc['metadata'].get(
'store') or loc['metadata'].get(
'store') not in CONF.enabled_backends):
store_id = _get_store_id_from_uri(loc['url'])
if store_id:
if 'store' in loc['metadata']:
old_store = loc['metadata']['store']
if old_store != store_id:
LOG.debug("Store '%(old)s' has changed to "
"'%(new)s' by operator, updating "
"the same in the location of image "
"'%(id)s'", {'old': old_store,
'new': store_id,
'id': image.image_id})
loc['metadata']['store'] = store_id
image_repo.save(image)
def get_updated_store_location(locations):
for loc in locations: for loc in locations:
store_id = _get_store_id_from_uri(loc['url']) store_id = _get_store_id_from_uri(loc['url'])
if store_id: if store_id:
if 'store' in loc['metadata']:
old_store = loc['metadata']['store']
if old_store != store_id:
LOG.debug("Store '%(old)s' has changed to "
"'%(new)s' by operator, updating "
"the same in the location of image "
"'%(id)s'", {'old': old_store,
'new': store_id,
'id': image_id})
loc['metadata']['store'] = store_id loc['metadata']['store'] = store_id
return locations
def get_dir_separator(): def get_dir_separator():
separator = '' separator = ''
staging_dir = "file://%s" % getattr( staging_dir = "file://%s" % getattr(
CONF, 'os_glance_staging_store').filesystem_store_datadir CONF, 'os_glance_staging_store').filesystem_store_datadir
if not staging_dir.endswith('/'): if not staging_dir.endswith('/'):
separator = '/' separator = '/'
return separator, staging_dir return separator, staging_dir
 End of changes. 3 change blocks. 
11 lines changed or deleted 23 lines changed or added

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