mirror of
https://github.com/evilhero/mylar
synced 2025-02-02 04:21:43 +00:00
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:
parent
fb3c30de94
commit
a32264eacd
1 changed files with 9 additions and 2 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue