Unnecessary "else" after "return" (#115)

* Unnecessary "else" after "return"
This commit is contained in:
Juha Ylitalo
2024-02-23 20:47:23 +02:00
committed by GitHub
parent fb02b47053
commit 85bdf89027

View File

@@ -178,7 +178,6 @@ def get_auth_schemes(r,path):
if DEBUG:
print('[debug][docker] Auth schemes found:{0}'.format([m for m in oauth]))
return [m.lower() for m in oauth]
else:
if DEBUG:
print('[debug][docker] No Auth schemes found')
return []
@@ -364,10 +363,7 @@ class Registry:
if json_result['schemaVersion'] == 1:
print("Docker schemaVersion 1 isn't supported for deleting by age now")
sys.exit(1)
else:
tag_config = json_result['config']
return tag_config
return json_result['config']
def get_image_age(self, image_name, image_config):
container_header = {"Accept": "{0}".format(
@@ -393,7 +389,6 @@ class Registry:
self.last_error = None
image_age = json.loads(response.text)
return image_age['created']
else:
print(" blob not found: {0}".format(self.last_error))
self.last_error = response.status_code
return []
@@ -681,9 +676,7 @@ def get_newer_tags(registry, image_name, hours, tags_list):
print("Keeping tag: {0} timestamp: {1}".format(
tag, image_age))
return tag
else:
print("Will delete tag: {0} timestamp: {1}".format(
tag, image_age))
print("Will delete tag: {0} timestamp: {1}".format(tag, image_age))
return None
print('---------------------------------')