Skip to content
Commits on Source (2)
......@@ -12,9 +12,9 @@ from rblib.certs import Certs
def whoami():
'''
"""
debugging function: check whether auth succeed
'''
"""
certs = Certs.from_browser()
with certs.requests() as req:
res = req.get("https://nm.debian.org/api/whoami")
......@@ -28,11 +28,13 @@ def send_req(args):
ret = res.status_code
if ret == retcodes.ok:
print('Scheduling successful!')
if args.debug: print(res.text)
if args.debug:
print(res.text)
elif ret == retcodes.bad:
print('Validation error!')
print(res.headers['X-Error-Message'])
if args.debug: print(res.text)
if args.debug:
print(res.text)
elif ret == 520:
print('Unknown error while scheduling, check the output below')
print(res.text)
......@@ -49,7 +51,8 @@ if __name__ == '__main__':
)
parser.add_argument(
'-d', '--debug',
help='dump the text from the scheduler also when otherwise not needed.',
help='dump the text from the scheduler also when otherwise '
'not needed.',
action='store_true',
)
args, remote_args = parser.parse_known_args()
......