(self, directory, manifest)
return (container_json, files)
Get image attributes from image directory in v2 schema 1 format
Get image attributes from image directory in v2 schema 1 format
Get image attributes from image directory in v2 schema 1 format
def _get_image_attributes_v2_s1(self, directory, manifest):
        """Get image attributes from image directory in v2 schema 1 format"""
        files = []
        for layer in reversed(manifest["fsLayers"]):
            layer_file = directory + '/' + layer["blobSum"]
            if not os.path.exists(layer_file):
                return (None, None)
            files.append(layer_file)
        try:
            json_string = manifest["history"][0]["v1Compatibility"].strip()
            container_json = json.loads(json_string)
        except (IOError, OSError, AttributeError, ValueError, TypeError,
                IndexError, KeyError):
            return (None, files)
        return (container_json, files)
def _get_image_attributes_v2_s1 ( self , directory , manifest ) : files = [ ] for layer in reversed ( manifest [ "fsLayers" ] ) : layer_file = directory + '/' + layer [ "blobSum" ] if not os . path . exists ( layer_file ) : return ( None , None ) files . append ( layer_file ) try : json_string = manifest [ "history" ] [ 0 ] [ "v1Compatibility" ] . strip ( ) container_json = json . loads ( json_string ) except ( IOError , OSError , AttributeError , ValueError , TypeError , IndexError , KeyError ) : return ( None , files ) return ( container_json , files )