Reset alarm timers back to 30 after orch sets them to 2

The alarm audit is set to 2 seconds by an alarm callback.
Once that callback has been processed, need to reset the
timer back to its default of 30 seconds.

Note: Patch orch did not encounter this issue, because its
audit called other code after the alarm callback, which reset
the timer.

Closes-Bug: 1921127
Change-Id: Iba82c71757c0a9e760926e81a42ba91b14196e0e
Signed-off-by: albailey <Al.Bailey@windriver.com>
This commit is contained in:
albailey 2021-03-24 15:09:33 -05:00
parent d182e9bcf2
commit a7b23615e3
4 changed files with 16 additions and 0 deletions

View File

@ -4,6 +4,7 @@
# SPDX-License-Identifier: Apache-2.0
#
from nfv_common import debug
from nfv_common import timers
from nfv_common.helpers import coroutine
@ -177,6 +178,9 @@ class FwUpdate(SwUpdate):
while self._nfvi_audit_inprogress:
timer_id = (yield)
# nfvi_alarms_callback sets timer to 2 seconds. reset back to 30
timers.timers_reschedule_timer(timer_id, 30)
if not self.nfvi_update():
DLOG.info("Audit no longer needed.")
break

View File

@ -4,6 +4,7 @@
# SPDX-License-Identifier: Apache-2.0
#
from nfv_common import debug
from nfv_common import timers
from nfv_common.helpers import coroutine
@ -183,6 +184,9 @@ class KubeUpgrade(SwUpdate):
while self._nfvi_audit_inprogress:
timer_id = (yield)
# nfvi_alarms_callback sets timer to 2 seconds. reset back to 30
timers.timers_reschedule_timer(timer_id, 30)
if not self.nfvi_update():
DLOG.info("Audit no longer needed.")
break

View File

@ -202,6 +202,9 @@ class SwPatch(SwUpdate):
while self._nfvi_audit_inprogress:
timer_id = (yield)
# nfvi_alarms_callback sets timer to 2 seconds
# nfvi_sw_patch_hosts_callback sets it back to 30
DLOG.info("Audit software patch hosts, timer_id=%s." % timer_id)
nfvi.nfvi_sw_mgmt_query_hosts(
self.nfvi_sw_patch_hosts_callback(timer_id))

View File

@ -4,6 +4,8 @@
# SPDX-License-Identifier: Apache-2.0
#
from nfv_common import debug
from nfv_common import timers
from nfv_common.helpers import coroutine
from nfv_vim import alarm
@ -163,6 +165,9 @@ class SwUpgrade(SwUpdate):
while self._nfvi_audit_inprogress:
timer_id = (yield)
# nfvi_alarms_callback sets timer to 2 seconds. reset back to 30
timers.timers_reschedule_timer(timer_id, 30)
if not self.nfvi_update():
DLOG.info("Audit no longer needed.")
break