From: Thierry Parmentelat Date: Fri, 25 Jun 2010 15:10:28 +0000 (+0200) Subject: display only active leases unless verbose X-Git-Tag: tests-5.0-7~2 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=108104742efb8a11d781fdf5cbf0712383ab734b;p=tests.git display only active leases unless verbose --- diff --git a/system/TestPlc.py b/system/TestPlc.py index 86826dd..1236395 100644 --- a/system/TestPlc.py +++ b/system/TestPlc.py @@ -713,10 +713,13 @@ class TestPlc: def list_leases (self): "list all leases known to the myplc" leases = self.apiserver.GetLeases(self.auth_root()) + now=int(time.time()) for l in leases: - utils.header("%s %s from %s until %s"%(l['hostname'],l['name'], - TestPlc.timestamp_printable(l['t_from']), - TestPlc.timestamp_printable(l['t_until']))) + current=l['t_until']>=now + if self.options.verbose or current: + utils.header("%s %s from %s until %s"%(l['hostname'],l['name'], + TestPlc.timestamp_printable(l['t_from']), + TestPlc.timestamp_printable(l['t_until']))) return True # create nodegroups if needed, and populate