fix `request error 401` problem (finally)
it turns out after reboot, we forget to re-authenticate in the script
This commit is contained in:
parent
0313930751
commit
e4a8cb04d0
|
|
@ -107,6 +107,8 @@ def main():
|
||||||
"Make sure your id, key, and ip addresses are correct."
|
"Make sure your id, key, and ip addresses are correct."
|
||||||
)
|
)
|
||||||
exit(1)
|
exit(1)
|
||||||
|
dpt.client_id_fp = args.get('dpt_id', "")
|
||||||
|
dpt.key_fp = args.get('dpt_key', "")
|
||||||
|
|
||||||
interactive(dpt, diagnosis=args.get('diagnosis', False))
|
interactive(dpt, diagnosis=args.get('diagnosis', False))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@ class DPT():
|
||||||
8444/tcp open unknown
|
8444/tcp open unknown
|
||||||
8445/tcp open unknown
|
8445/tcp open unknown
|
||||||
'''
|
'''
|
||||||
|
self.client_id_fp = ""
|
||||||
|
self.key_fp = ""
|
||||||
self.debug = debug
|
self.debug = debug
|
||||||
if addr is None:
|
if addr is None:
|
||||||
self.addr = "digitalpaper.local"
|
self.addr = "digitalpaper.local"
|
||||||
|
|
|
||||||
|
|
@ -125,6 +125,11 @@ def obtain_diagnosis_access(dpt):
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
dpt.err_print(str(e))
|
dpt.err_print(str(e))
|
||||||
return False
|
return False
|
||||||
|
if not dpt.authenticate(dpt.client_id_fp, dpt.key_fp):
|
||||||
|
dpt.err_print("Cannot reauthenticate after reboot")
|
||||||
|
dpt.err_print("Client id filepath: {}".format(dpt.client_id_fp))
|
||||||
|
dpt.err_print("Client key filepath: {}".format(dpt.key_fp))
|
||||||
|
return False
|
||||||
# step 2: reset root password
|
# step 2: reset root password
|
||||||
if not reset_root_password(dpt):
|
if not reset_root_password(dpt):
|
||||||
return False
|
return False
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue