Skip to content
Snippets Groups Projects
Commit bd3c568f authored by Sam Roberts's avatar Sam Roberts
Browse files

handle ncclient-specific exceptions when SSH connection can't be made

parent c960660b
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@ import os
import re
from typing import List
import ncclient.transport.errors
from celery import Task, states, chord
from celery.result import AsyncResult
......@@ -655,7 +656,7 @@ def retrieve_and_persist_interface_info(
try:
interface_info_str = juniper.get_interface_info_for_router(hostname, InventoryTask.config["ssh"])
logger.info(f'interface-info rpc success from {hostname}')
except (ConnectionError, juniper.TimeoutError, InventoryTaskError):
except (ConnectionError, juniper.TimeoutError, InventoryTaskError, ncclient.transport.errors.SSHError):
msg = f'error loading interface-info data from {hostname}'
logger.exception(msg)
update_callback(msg)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment