Skip to content

Commit d18025a

Browse files
Fix Issue 113 (#114)
* Fix Issue 113: setting exception handler for UniconAuthenticationError when validating credentials. * black formatting fix * black formatting fix * black formatting fix * black formatting fix * Update CHANGELOG.md --------- Co-authored-by: tzarski0 <92273798+tzarski0@users.noreply.github.com>
1 parent 3e1a4f6 commit d18025a

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Catalyst SD-WAN Lab 2.1.3 [unreleased]
2+
3+
- Fix issue where backup task might fail with generic traceback if SD-WAN Edge uses custom credentials
4+
15
# Catalyst SD-WAN Lab 2.1.2 [Jul 28, 2025]
26

37
- Update minimum versions of aiohttp, cisco-sdwan, urllib3 and virl2-client packages

catalyst_sdwan_lab/tasks/backup.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)