commit 894afa9681590376bf39567435652455618d1eba
Author: Radek Novacek <rad.n(a)centrum.cz>
Date: Thu Aug 23 11:27:57 2012 +0200
Make the interval option work again
virt-who.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/virt-who.py b/virt-who.py
index eff9015..c9afa0f 100644
--- a/virt-who.py
+++ b/virt-who.py
@@ -442,9 +442,11 @@ def main():
if virtWho.send():
# Check if connection is established each 'RetryInterval'
seconds
slept = 0
- while slept <= options.interval:
+ while slept < options.interval:
# Sleep 'RetryInterval' or the rest of options.interval
t = min(RetryInterval, options.interval - slept)
+ # But sleep at least one second
+ t = max(t, 1)
time.sleep(t)
slept += t
Show replies by date