Skip to content
Snippets Groups Projects
Commit f47e44c6 authored by David Schmitz's avatar David Schmitz
Browse files

logging cleanup

parent d9aa63ed
No related branches found
No related tags found
No related merge requests found
...@@ -99,18 +99,19 @@ def deactivate_route(routepk, **kwargs): ...@@ -99,18 +99,19 @@ def deactivate_route(routepk, **kwargs):
if initial_status not in ("ACTIVE", "PENDING", "ERROR"): if initial_status not in ("ACTIVE", "PENDING", "ERROR"):
logger.error("tasks::deactivate(): Cannot deactivate route that is not in ACTIVE or potential ACTIVE status.") logger.error("tasks::deactivate(): Cannot deactivate route that is not in ACTIVE or potential ACTIVE status.")
return return
logger.info("tasks::deactivate_route(): initial_status="+str(initial_status))
applier = PR.Applier(route_object=route) applier = PR.Applier(route_object=route)
# Delete from router via NETCONF # Delete from router via NETCONF
commit, response = applier.apply(operation="delete") commit, response = applier.apply(operation="delete")
reason_text = '' reason_text = ''
logger.info("tasks::delete(): initial_status="+str(initial_status)) logger.info("tasks::deactivate_route(): commit="+str(commit))
if commit: if commit:
route.status="INACTIVE" route.status="INACTIVE"
try: try:
snmp_add_initial_zero_value(str(route.id), False) snmp_add_initial_zero_value(str(route.id), False)
except Exception as e: except Exception as e:
logger.error("edit(): route="+str(route)+", INACTIVE, add_null_value failed: "+str(e)) logger.error("tasks::deactivate_route(): route="+str(route)+", INACTIVE, add_null_value failed: "+str(e))
announce("[%s] Suspending rule : %s%s- Result %s" % (route.applier_username_nice, route.name, reason_text, response), route.applier, route) announce("[%s] Suspending rule : %s%s- Result %s" % (route.applier_username_nice, route.name, reason_text, response), route.applier, route)
route.status = "INACTIVE" route.status = "INACTIVE"
...@@ -146,6 +147,9 @@ def delete_route(routepk, **kwargs): ...@@ -146,6 +147,9 @@ def delete_route(routepk, **kwargs):
deactivate_route(routepk) deactivate_route(routepk)
except TimeoutError: except TimeoutError:
pass pass
except Exception as e:
logger.info("tasks::delete_route(): exception during deactivate_route: "+str(e))
logger.info("tasks::delete_route(): deactivate_route done => route.status="+str(route.status))
if route.status != "INACTIVE" and delete_route.request.retries < settings.NETCONF_MAX_RETRY_BEFORE_ERROR: if route.status != "INACTIVE" and delete_route.request.retries < settings.NETCONF_MAX_RETRY_BEFORE_ERROR:
# Repeat due to error in deactivation # Repeat due to error in deactivation
route.status = "PENDING" route.status = "PENDING"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment