Skip to content
Snippets Groups Projects
Commit e0f80f03 authored by Robert Latta's avatar Robert Latta
Browse files

separated task call from implementation. RE. DBOARD3-898

parent 3bd26897
No related branches found
Tags 0.108
No related merge requests found
......@@ -568,7 +568,12 @@ def retrieve_and_persist_neteng_managed_device_list(
@log_task_entry_and_exit
def reload_router_config_try_all(self, hostname, lab=False):
try:
<<<<<<< Updated upstream
reload_router_config_nokia(hostname, lab)
=======
_reload_router_config_nokia(
hostname, lab, self.log_info, self.log_warning)
>>>>>>> Stashed changes
except Exception as e1:
self.log_warning(
f'error loading {hostname} info: {e1} - trying juniper')
......@@ -591,12 +596,17 @@ def reload_router_config_try_all(self, hostname, lab=False):
@log_task_entry_and_exit
def reload_router_config_nokia(self, hostname, lab=False):
try:
<<<<<<< Updated upstream
self.log_info(
f'loading netconf data for {"lab " if lab else ""} {hostname}')
netconf_config = retrieve_and_persist_netconf_config_nokia(
hostname, lab, self.log_warning)
r = get_next_redis(InventoryTask.config)
refresh_nokia_interface_list(hostname, netconf_config, r, lab)
=======
_reload_router_config_nokia(
hostname, lab, self.log_info, self.log_warning)
>>>>>>> Stashed changes
except Exception as e:
errmsg = f'unhandled exception loading {hostname} info: {e}'
logger.exception(errmsg)
......@@ -605,6 +615,19 @@ def reload_router_config_nokia(self, hostname, lab=False):
# TODO: re-raise and handle in some common way for all tasks
@log_task_entry_and_exit
def _reload_router_config_nokia(
hostname, lab=False,
info_callback=lambda s: None,
warning_callback=lambda s: None):
info_callback(
f'loading netconf data for {"lab " if lab else ""} {hostname}')
netconf_doc = retrieve_and_persist_netconf_config_nokia(
hostname, lab, warning_callback)
r = get_next_redis(InventoryTask.config)
refresh_nokia_interface_list(hostname, netconf_doc, r, lab)
def retrieve_and_persist_netconf_config_nokia(
hostname, lab=False, update_callback=lambda s: None):
redis_key = f'netconf-nokia:{hostname}'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment