From c2239ec0e75a5e6a3f787fdd03fb1a5749a47120 Mon Sep 17 00:00:00 2001 From: Serge Noiraud Date: Tue, 16 Feb 2010 18:54:49 +0000 Subject: [PATCH] GeoView : differentiate ping between windows and linux. svn: r14404 --- src/plugins/view/geoview.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/view/geoview.py b/src/plugins/view/geoview.py index fda506f06..3389280c1 100644 --- a/src/plugins/view/geoview.py +++ b/src/plugins/view/geoview.py @@ -2291,16 +2291,18 @@ class GeoView(HtmlView): """ if constfunc.win(): command = "ping -n 2 " + stringtosearch = "([0-9]*)%.*" #elif constfunc.mac(): # command = "ping -c 2 " else: + stringtosearch = ".*, (.*)% packet loss.*" command = "ping -c 2 " pinghost = os.popen(command + host, "r") line = pinghost.read() if not line: self.no_network = True - result = re.search('.*, (.*)% packet loss.*', line) + result = re.search(stringtosearch, line) if result != None and int(result.group(1)) == 0: if self.no_network == True: self.no_network = False