Aug-25-2021, 08:56 PM
Hello!
I'm pulling out logs from remote hosts to my server for processing.
The server has a faceless account and all the Hosts have it added as an admin(admin group).
Sometimes, a new Host has a bad configuration and it asks for UserName...
I thought I can use try/except to keep going if an error or cannot log in...
for some reason, the code just stops with the message:
"The password is invalid for..."
I thought "try/except' will make it keep going but it is not:
Any idea on how to ignore the message ""The password is invalid for...""?
Thank you!
I'm pulling out logs from remote hosts to my server for processing.
The server has a faceless account and all the Hosts have it added as an admin(admin group).
Sometimes, a new Host has a bad configuration and it asks for UserName...
I thought I can use try/except to keep going if an error or cannot log in...
for some reason, the code just stops with the message:
"The password is invalid for..."
I thought "try/except' will make it keep going but it is not:
try : subprocess.call("net use U: /delete /yes") time.sleep(1) subprocess.call("net use U: "+"\\\\"+itm+"\\c$\\SMTS\\TDR_Logs") tr = time.localtime() cutr = time.strftime("%Y-%m-%d %I:%M:%S", tr) print(f" Dir mounted -->> {cutr} -- {host_path}") except OSError as st : print(f" Error --> {st}") pass
Any idea on how to ignore the message ""The password is invalid for...""?
Thank you!