From a32264eacd4ddbb56123ee074a4836846e6b8abb Mon Sep 17 00:00:00 2001 From: evilhero Date: Thu, 19 Nov 2015 21:25:00 -0500 Subject: [PATCH] FIX: When sending issues to android tablet (via Sync/Send) using the Readinglist, would always return a 'host is not Reachable at this time' error message when it would be reachable (only occurred on Windows) --- mylar/readinglist.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mylar/readinglist.py b/mylar/readinglist.py index 9b7f0afe..509b947f 100644 --- a/mylar/readinglist.py +++ b/mylar/readinglist.py @@ -213,7 +213,10 @@ class Readinglist(object): #fhost = mylar.TAB_HOST.find(':') host = mylar.TAB_HOST[:mylar.TAB_HOST.find(':')] - cmdstring = str('ping -c1 ' + str(host)) + if 'windows' not in mylar.OS_DETECT.lower(): + cmdstring = str('ping -c1 ' + str(host)) + else: + cmdstring = str('ping -n 1 ' + str(host)) cmd = shlex.split(cmdstring) try: output = subprocess.check_output(cmd) @@ -221,7 +224,11 @@ class Readinglist(object): logger.info(module + ' The host {0} is not Reachable at this time.'.format(cmd[-1])) return else: - logger.info(module + ' The host {0} is Reachable. Preparing to send files.'.format(cmd[-1])) + if 'unreachable' in output: + logger.info(module + ' The host {0} is not Reachable at this time.'.format(cmd[-1])) + return + else: + logger.info(module + ' The host {0} is Reachable. Preparing to send files.'.format(cmd[-1])) success = mylar.ftpsshup.sendfiles(sendlist)