From 1fa2263e5c3cb95262dd38a686eff67bfa8033bd Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 21 Sep 2011 10:30:37 +0200 Subject: [PATCH] cosmtic for displaying an ip pool --- system/Substrate.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/system/Substrate.py b/system/Substrate.py index ae1d53d..619b94e 100644 --- a/system/Substrate.py +++ b/system/Substrate.py @@ -98,8 +98,8 @@ class PoolItem: def char (self): if self.status==None: return '?' - elif self.status=='busy': return '*' - elif self.status=='free': return '.' + elif self.status=='busy': return '+' + elif self.status=='free': return '-' elif self.status=='mine': return 'M' elif self.status=='starting': return 'S' @@ -186,11 +186,14 @@ class Pool: def _sense (self): for item in self.pool: if item.status is not None: + print item.char(), continue if self.check_ping (item.hostname): item.status='busy' + print '*', else: item.status='free' + print '.', def sense (self): print 'Sensing IP pool',self.message, @@ -215,8 +218,6 @@ class Pool: command="ping -c 1 %s 1 %s"%(Pool.ping_timeout_option,hostname) (status,output) = commands.getstatusoutput(command) - if status==0: print '*', - else: print '.', return status == 0 #################### -- 2.43.0