@@ -35,7 +35,10 @@ def validate_credentials(pylab: ClPyats, node_label: str) -> bool:
3535 try :
3636 pylab .run_command (node_label , "show version" )
3737 return True
38- except unicon .core .errors .ConnectionError as conn_err :
38+ except (
39+ unicon .core .errors .UniconAuthenticationError ,
40+ unicon .core .errors .ConnectionError ,
41+ ) as conn_err :
3942 current_exception = conn_err
4043 # Loop to inspect the chain of causes
4144 while current_exception :
@@ -44,7 +47,7 @@ def validate_credentials(pylab: ClPyats, node_label: str) -> bool:
4447 unicon .core .errors .UniconAuthenticationError ,
4548 ) or isinstance (
4649 current_exception ,
47- unicon .core .errors .CredentialsExhaustedError ,
50+ unicon .core .errors .ConnectionError ,
4851 ):
4952 return False
5053 # Move to the next cause in the chain
@@ -107,7 +110,7 @@ def check_pyats_device_connectivity(
107110 return [personality , node_type , pylab ]
108111 else :
109112 exit (
110- f"Could not login to { node_label } using admin username and default or SD-WAN Manager password."
113+ f"Could not login to { node_label } using admin username and default or SD-WAN Manager password. "
111114 f"Please fix admin user password and rerun the script."
112115 )
113116 except unicon .core .errors .ConnectionError as conn_err :
@@ -130,7 +133,7 @@ def check_pyats_device_connectivity(
130133 return [personality , node_type , pylab ]
131134 else :
132135 exit (
133- f"Could not login to { node_label } using admin username and default or SD-WAN Manager password."
136+ f"Could not login to { node_label } using admin username and default or SD-WAN Manager password. "
134137 f"Please fix admin user password and rerun the script."
135138 )
136139 # Move to the next cause in the chain
0 commit comments