def get_image_manifest(self): '''Assuming that there is a temp folder with a manifest.json of an image inside, get a dict of the manifest.json file''' temp_path = os.path.abspath(temp_folder) with pushd(temp_path): with open(manifest_file) as f: json_obj = json.loads(f.read()) return json_obj
def get_image_config(self, manifest): '''Assuming there now exists a working directory where the image metadata exists, return the image config''' config_file = self.get_image_config_file(manifest) # assuming that the config file path is in the same root path as the # manifest file temp_path = os.path.abspath(temp_folder) with pushd(temp_path): with open(config_file) as f: json_obj = json.loads(f.read()) return json_obj