Skip to content

Commit

Permalink
Improved error handling. This should fix the 'FileNotFound' error.
Browse files Browse the repository at this point in the history
  • Loading branch information
mortensteenrasmussen committed May 31, 2019
1 parent d92bc75 commit b03663e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docker-registry-cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,15 @@ def exit_with_error(message):
manifest = json.loads(k.get_contents_as_string().decode())
except Exception as e:
error = True
print(e)
print("Caught error trying to read manifest, ignoring.")

else:
shasum = open(filename, 'r').read().split(":")[1]
try:
manifest = json.loads(open("%s/sha256/%s/%s/data" % (blob_dir, shasum[0:2], shasum)).read())
except Exception as e:
error = True
print(e)
print("Caught error trying to read manifest, ignoring.")

if error:
linked_manifests.add(shasum)
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ certifi==2018.11.29
chardet==3.0.4
idna==2.8
requests==2.21.0
urllib3==1.24.1
urllib3==1.24.2

0 comments on commit b03663e

Please sign in to comment.