From dd14c067119f11ea3794a7a2f27ffea4c65690d8 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Thu, 12 Dec 2024 16:27:50 -0800 Subject: [PATCH] If we can't get the warmboot-finalizer state, don't exit (#15985) In some cases, connecting to the device may fail for whatever reason. If this happens, the current code returns an empty string as the warmboot-finalizer state. There's a for-loop that exits when the warmboot-finalizer state is no longer active. An empty string being returned here breaks that. To avoid that, don't exit this loop if we get an empty string. Signed-off-by: Saikrishna Arcot --- ansible/roles/test/files/ptftests/py3/advanced-reboot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/test/files/ptftests/py3/advanced-reboot.py b/ansible/roles/test/files/ptftests/py3/advanced-reboot.py index 4dfaa53ba63..23e7bbbcaae 100644 --- a/ansible/roles/test/files/ptftests/py3/advanced-reboot.py +++ b/ansible/roles/test/files/ptftests/py3/advanced-reboot.py @@ -1061,7 +1061,7 @@ def check_warmboot_finalizer(self, finalizer_timeout): self.finalizer_state = self.get_warmboot_finalizer_state() self.log('warmboot finalizer service state {}'.format(self.finalizer_state)) count = 0 - while self.finalizer_state == 'activating': + while self.finalizer_state == 'activating' or self.finalizer_state == '': self.finalizer_state = self.get_warmboot_finalizer_state() self.log('warmboot finalizer service state {}'.format(self.finalizer_state)) time.sleep(10)