12
registry.py
12
registry.py
@@ -216,7 +216,7 @@ class Registry:
|
|||||||
(r.username, r.password) = r.parse_login(login)
|
(r.username, r.password) = r.parse_login(login)
|
||||||
if r.last_error is not None:
|
if r.last_error is not None:
|
||||||
print(r.last_error)
|
print(r.last_error)
|
||||||
exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
r.hostname = host
|
r.hostname = host
|
||||||
r.no_validate_ssl = no_validate_ssl
|
r.no_validate_ssl = no_validate_ssl
|
||||||
@@ -249,7 +249,7 @@ class Registry:
|
|||||||
# print("cannot connect to {0}\nerror {1}".format(
|
# print("cannot connect to {0}\nerror {1}".format(
|
||||||
# self.hostname,
|
# self.hostname,
|
||||||
# error))
|
# error))
|
||||||
# exit(1)
|
# sys.exit(1)
|
||||||
if str(result.status_code)[0] == '2':
|
if str(result.status_code)[0] == '2':
|
||||||
self.last_error = None
|
self.last_error = None
|
||||||
return result
|
return result
|
||||||
@@ -356,7 +356,7 @@ class Registry:
|
|||||||
json_result = json.loads(config_result.text)
|
json_result = json.loads(config_result.text)
|
||||||
if json_result['schemaVersion'] == 1:
|
if json_result['schemaVersion'] == 1:
|
||||||
print("Docker schemaVersion 1 isn't supported for deleting by age now")
|
print("Docker schemaVersion 1 isn't supported for deleting by age now")
|
||||||
exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
tag_config = json_result['config']
|
tag_config = json_result['config']
|
||||||
|
|
||||||
@@ -698,7 +698,7 @@ def main_loop(args):
|
|||||||
if args.read_password:
|
if args.read_password:
|
||||||
if args.login is None:
|
if args.login is None:
|
||||||
print("Please provide -l when using -w")
|
print("Please provide -l when using -w")
|
||||||
exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if ':' in args.login:
|
if ':' in args.login:
|
||||||
(username, password) = args.login.split(':', 1)
|
(username, password) = args.login.split(':', 1)
|
||||||
@@ -715,7 +715,7 @@ def main_loop(args):
|
|||||||
|
|
||||||
if len(password) == 0:
|
if len(password) == 0:
|
||||||
print("Password was not provided")
|
print("Password was not provided")
|
||||||
exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if password[-(len(os.linesep)):] == os.linesep:
|
if password[-(len(os.linesep)):] == os.linesep:
|
||||||
password = password[0:-(len(os.linesep))]
|
password = password[0:-(len(os.linesep))]
|
||||||
@@ -804,4 +804,4 @@ if __name__ == "__main__":
|
|||||||
main_loop(args)
|
main_loop(args)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print("Ctrl-C pressed, quitting")
|
print("Ctrl-C pressed, quitting")
|
||||||
exit(1)
|
sys.exit(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user