(self, directory, manifest)
return (container_json, files)
Get image attributes from image directory in v2 schema 2 format
Get image attributes from image directory in v2 schema 2 format
Get image attributes from image directory in v2 schema 2 format
def _get_image_attributes_v2_s2(self, directory, manifest):
        """Get image attributes from image directory in v2 schema 2 format"""
        files = []
        for layer in manifest["layers"]:
            layer_file = directory + '/' + layer["digest"]
            if not os.path.exists(layer_file):
                return (None, None)
            files.append(layer_file)
        try:
            json_file = directory + '/' + manifest["config"]["digest"]
            container_json = json.loads(FileUtil(json_file).getdata('r'))
        except (IOError, OSError, AttributeError, ValueError, TypeError,
                IndexError, KeyError):
            return (None, files)
        return (container_json, files)
def _get_image_attributes_v2_s2 ( self , directory , manifest ) : files = [ ] for layer in manifest [ "layers" ] : layer_file = directory + '/' + layer [ "digest" ] if not os . path . exists ( layer_file ) : return ( None , None ) files . append ( layer_file ) try : json_file = directory + '/' + manifest [ "config" ] [ "digest" ] container_json = json . loads ( FileUtil ( json_file ) . getdata ( 'r' ) ) except ( IOError , OSError , AttributeError , ValueError , TypeError , IndexError , KeyError ) : return ( None , files ) return ( container_json , files )