fix: correctly retry device read when device is unstable

Cause: The retry loop for reading from a device would bail out of the loop
before retrying because the loop should have used a greater-than-or-equal
to test the retry condition rather than a less-than.

Consequence: If the device is not stable, the loop would bail and issue
an exception rather than trying to retry the read.

Fix: Use the correct loop condition.

Result: The network role can correctly retry the read when the device
is unstable.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
This commit is contained in:
Rich Megginson 2026-05-22 15:00:14 -06:00 committed by Richard Megginson
parent fd99c0b783
commit 2f9b128e2b
2 changed files with 61 additions and 2 deletions

View file

@ -235,7 +235,7 @@ class SysUtil:
"cannot read stable link-infos. They keep changing"
)
except Exception:
if try_count < 50:
if try_count >= 50:
raise
continue
break