Browse Source

Merge "Handle containers without a namespace" into stable/train

changes/69/779169/1
Zuul 2 months ago
committed by Gerrit Code Review
parent
commit
96b5874258
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      tripleo_common/image/image_export.py

+ 6
- 1
tripleo_common/image/image_export.py View File

@ -382,12 +382,17 @@ def build_catalog():
catalog_entries = []
LOG.debug('Rebuilding %s' % catalog_path)
images_path = os.path.join(IMAGE_EXPORT_DIR, 'v2')
metadata_set = set(['blobs', 'manifests', 'tags'])
for namespace in os.listdir(images_path):
namespace_path = os.path.join(images_path, namespace)
if not os.path.isdir(namespace_path):
continue
for image in os.listdir(namespace_path):
contents_set = set(os.listdir(namespace_path))
# handle containers with no namespaces
if metadata_set.issubset(contents_set):
catalog_entries.append(namespace)
for image in list(contents_set - metadata_set):
catalog_entries.append('%s/%s' % (namespace, image))
catalog = {'repositories': catalog_entries}


Loading…
Cancel
Save