diff --git a/image/docker/schema1.py b/image/docker/schema1.py index 84b9f63a1..6f8660e61 100644 --- a/image/docker/schema1.py +++ b/image/docker/schema1.py @@ -194,10 +194,6 @@ class DockerSchema1Manifest(ManifestInterface): if validate: self._validate() - @classmethod - def for_latin1_bytes(cls, encoded_bytes, validate=True): - return DockerSchema1Manifest(Bytes.for_string_or_unicode(encoded_bytes), validate) - def _validate(self): if not self._signatures: return diff --git a/image/docker/test/test_schema1.py b/image/docker/test/test_schema1.py index 07c323ffc..4392ae8cb 100644 --- a/image/docker/test/test_schema1.py +++ b/image/docker/test/test_schema1.py @@ -131,7 +131,7 @@ def test_validate_manifest_with_unicode_encoded(): with open(os.path.join(test_dir, 'manifest_unicode_row.json'), 'r') as f: manifest_bytes = json.loads(f.read())[0]['json_data'] - manifest = DockerSchema1Manifest.for_latin1_bytes(manifest_bytes, validate=True) + manifest = DockerSchema1Manifest(Bytes.for_string_or_unicode(manifest_bytes), validate=True) digest = manifest.digest assert digest == 'sha256:dde3714ce7e23edc6413aa85c0b42792e4f2f79e9ea36afc154d63ff3d04e86c' assert manifest.created_datetime diff --git a/workers/tagbackfillworker.py b/workers/tagbackfillworker.py index e3fb1d5e6..226a7f9dc 100644 --- a/workers/tagbackfillworker.py +++ b/workers/tagbackfillworker.py @@ -175,7 +175,7 @@ def backfill_tag(repositorytag): if lookup_map_row(repositorytag): return False - # Grab the manifest for the RepositoryTag, backfilling is necessary. + # Grab the manifest for the RepositoryTag, backfilling as necessary. manifest_id = _get_manifest_id(repositorytag) if manifest_id is None: return False @@ -269,7 +269,8 @@ def _backfill_manifest(tag_manifest): # without additional rows or data, as it will eventually not be useful. is_broken = False try: - manifest = DockerSchema1Manifest.for_latin1_bytes(tag_manifest.json_data, validate=False) + manifest = DockerSchema1Manifest(Bytes.for_string_or_unicode(tag_manifest.json_data), + validate=False) except ManifestException: logger.exception('Exception when trying to parse manifest %s', tag_manifest.id) manifest = BrokenManifest(tag_manifest.digest, tag_manifest.json_data)