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

rule_editing: remove synthetic adding of a zero stat count when a rule is...

rule_editing: remove synthetic adding of a zero stat count when a rule is edited on a router, as actually no reset of the statistic values happen on the router
parent 6071d36a
No related branches found
No related tags found
No related merge requests found
...@@ -82,11 +82,12 @@ def edit(routepk, callback=None): ...@@ -82,11 +82,12 @@ def edit(routepk, callback=None):
route.status = "ACTIVE" route.status = "ACTIVE"
route.response = response route.response = response
route.save() # save() has to be called before snmp_add_initial_zero_value, as last_updated DB filed is updated now on every call of save() and last db_measurement time must become >= this new last_updated value route.save() # save() has to be called before snmp_add_initial_zero_value, as last_updated DB filed is updated now on every call of save() and last db_measurement time must become >= this new last_updated value
try: if False: # actually wrong to use it for an edited active rule, as the stats values do not drop to zero on the JUNOS router
#snmp_add_initial_zero_value.delay(str(route.id), True) try:
snmp_add_initial_zero_value(routepk, route.id, True) #snmp_add_initial_zero_value.delay(str(route.id), True)
except Exception as e: snmp_add_initial_zero_value(routepk, route.id, True)
logger.error("tasks::edit(): route="+str(route)+", ACTIVE, add_initial_zero_value failed: "+str(e)) except Exception as e:
logger.error("tasks::edit(): route="+str(route)+", ACTIVE, add_initial_zero_value failed: "+str(e))
elif response=="Task timeout": elif response=="Task timeout":
if deactivate_route.request.retries < settings.NETCONF_MAX_RETRY_BEFORE_ERROR: if deactivate_route.request.retries < settings.NETCONF_MAX_RETRY_BEFORE_ERROR:
# repeat the action # repeat the action
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment