Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'in: %(layer_format_version_file)r. '
'Supported version: %(supported_format_version)r') % locals()
else:
print('Missing layer VERSION for:', layer_dir)
if not LAYER_JSON_FILE in files:
print('Missing layer json for:', layer_dir)
return Layer(layer_id=layer_id)
# load data
with open(join(layer_dir, LAYER_JSON_FILE)) as layer_json:
layer_data = json.load(layer_json, object_pairs_hook=OrderedDict)
# Note: it is possible to have an EMPTY layer.tar that is a link to another
# non-empty layer.tar
if LAYER_TAR_FILE in files:
layer_tar = join(layer_dir, LAYER_TAR_FILE)
layer_digest = sha256_digest(layer_tar)
layer_size = filetype.get_size(layer_tar)
else:
layer_digest = None
layer_size = 0
# do not rely on this
if 'Size' in layer_data:
del layer_data['Size']
# do not rely on this
if 'id' in layer_data:
lid = layer_data.pop('id')
# make some basic checks
assert layer_id == lid
'Supported version: %(supported_format_version)r') % locals()
else:
print('Missing layer VERSION for:', layer_dir)
if not LAYER_JSON_FILE in files:
print('Missing layer json for:', layer_dir)
return Layer(layer_id=layer_id)
# load data
with open(join(layer_dir, LAYER_JSON_FILE)) as layer_json:
layer_data = json.load(layer_json, object_pairs_hook=OrderedDict)
# Note: it is possible to have an EMPTY layer.tar that is a link to another
# non-empty layer.tar
if LAYER_TAR_FILE in files:
layer_tar = join(layer_dir, LAYER_TAR_FILE)
layer_digest = sha256_digest(layer_tar)
layer_size = filetype.get_size(layer_tar)
else:
layer_digest = None
layer_size = 0
# do not rely on this
if 'Size' in layer_data:
del layer_data['Size']
# do not rely on this
if 'id' in layer_data:
lid = layer_data.pop('id')
# make some basic checks
assert layer_id == lid