From dcf312d94d382665a5a425b805bdab5fcffaa683 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Tue, 20 Nov 2018 12:55:45 +0200 Subject: [PATCH] Fix exception bases for manifest exceptions --- image/docker/schema2/config.py | 4 +++- image/docker/schema2/list.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/image/docker/schema2/config.py b/image/docker/schema2/config.py index 1fd3a8b49..37c91501c 100644 --- a/image/docker/schema2/config.py +++ b/image/docker/schema2/config.py @@ -100,6 +100,8 @@ from jsonschema import validate as validate_schema, ValidationError from dateutil.parser import parse as parse_date from digest import digest_tools +from image.docker import ManifestException + DOCKER_SCHEMA2_CONFIG_HISTORY_KEY = "history" DOCKER_SCHEMA2_CONFIG_ROOTFS_KEY = "rootfs" @@ -112,7 +114,7 @@ DOCKER_SCHEMA2_CONFIG_TYPE_KEY = "type" LayerHistory = namedtuple('LayerHistory', ['created', 'created_datetime', 'command', 'is_empty']) -class MalformedSchema2Config(Exception): +class MalformedSchema2Config(ManifestException): """ Raised when a config fails an assertion that should be true according to the Docker Manifest v2.2 Config Specification. diff --git a/image/docker/schema2/list.py b/image/docker/schema2/list.py index 20004704e..65a18ab8f 100644 --- a/image/docker/schema2/list.py +++ b/image/docker/schema2/list.py @@ -31,7 +31,7 @@ DOCKER_SCHEMA2_MANIFESTLIST_FEATURES_KEY = 'features' DOCKER_SCHEMA2_MANIFESTLIST_VARIANT_KEY = 'variant' -class MalformedSchema2ManifestList(Exception): +class MalformedSchema2ManifestList(ManifestException): """ Raised when a manifest list fails an assertion that should be true according to the Docker Manifest v2.2 Specification.