From 3da17bbda71475d4ec59033d1f90d1b19e2de26e Mon Sep 17 00:00:00 2001 From: Joe Recchia Date: Wed, 9 Nov 2022 10:33:43 -0500 Subject: [PATCH] lightweight-check-mlag-health: Changed sleep time The sleep time to re-check the MLAG status should be the minimum of the polling interval and remaining time left before timeout values Author: Joe Recchia Change-Id: Ief087033c50d22ba376eaa574409a85d7c2e4212 --- .../check-mlag-health/script.py | 2 +- lightweight-check-mlag-health-action-pack/config.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lightweight-check-mlag-health-action-pack/check-mlag-health/script.py b/lightweight-check-mlag-health-action-pack/check-mlag-health/script.py index c7d8f73..0d0474f 100644 --- a/lightweight-check-mlag-health-action-pack/check-mlag-health/script.py +++ b/lightweight-check-mlag-health-action-pack/check-mlag-health/script.py @@ -64,7 +64,7 @@ def isMlagUp(): # If mlag is not up, log it's current status ctx.alog(status) # Calculate how long before next check, and ensure that we don't go over the timeout - sleepTime = max(pollInterval, duration) + sleepTime = min(pollInterval, duration) time.sleep(sleepTime) # Update the remaining time duration -= sleepTime diff --git a/lightweight-check-mlag-health-action-pack/config.yaml b/lightweight-check-mlag-health-action-pack/config.yaml index 4ef7bd9..808c207 100644 --- a/lightweight-check-mlag-health-action-pack/config.yaml +++ b/lightweight-check-mlag-health-action-pack/config.yaml @@ -1,4 +1,4 @@ type: PACKAGE -version: 1.0.0 +version: 1.0.1 name: lightweight-check-mlag-health Action package description: Action package containing a custom script that monitors a device's mlag ports health to ensure they come up