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)

This commit is contained in:
evilhero 2015-11-19 21:25:00 -05:00
parent fb3c30de94
commit a32264eacd
1 changed files with 9 additions and 2 deletions

View File

@ -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)