Skip to content
Snippets Groups Projects
Commit bc1fa926 authored by Neda Moeini's avatar Neda Moeini
Browse files

Fixed calling functions outside the app context error.

parent fa7e42f1
Branches
Tags
1 merge request!38Fixed calling functions outside the app context error.
......@@ -915,17 +915,20 @@ def interfaces(hostname=None):
return Response(result, mimetype="application/json")
def get_netdash_equipment() -> Dict[str, str]:
def get_netdash_equipment(config, use_next_redis=False) -> Dict[str, str]:
"""Get the netdash equipment mapping from redis."""
current_redis = common.get_current_redis()
return json.loads(current_redis.get('netdash').decode('utf-8'))
if use_next_redis:
r = tasks_common.get_next_redis(config)
else:
r = tasks_common.get_current_redis(config)
return json.loads(r.get('netdash').decode('utf-8'))
def load_error_report_interfaces(
config, hostname=None, use_next_redis=False
):
interfaces = _load_interfaces(config, hostname, use_next_redis=use_next_redis)
netdash_equipment = get_netdash_equipment()
netdash_equipment = get_netdash_equipment(config, use_next_redis)
def filter_interface(interface: dict):
return all(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment