mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 21:29:24 +01:00
Unix: fixed uncaught OSError exception raised when executing ping fails.
Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
This commit is contained in:
parent
e178d04522
commit
6df6d477f1
@ -262,12 +262,16 @@ class Unix(callbacks.Plugin):
|
|||||||
else:
|
else:
|
||||||
try: host = host.group(0)
|
try: host = host.group(0)
|
||||||
except AttributeError: pass
|
except AttributeError: pass
|
||||||
|
|
||||||
inst = subprocess.Popen([pingCmd,'-c','1', host],
|
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
stderr=subprocess.PIPE,
|
|
||||||
stdin=file(os.devnull))
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
inst = subprocess.Popen([pingCmd,'-c','1', host],
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.PIPE,
|
||||||
|
stdin=file(os.devnull))
|
||||||
|
except OSError, e:
|
||||||
|
irc.error('It seems the configured ping command was '
|
||||||
|
'not available (%s).' % e, Raise=True)
|
||||||
|
|
||||||
result = inst.communicate()
|
result = inst.communicate()
|
||||||
|
|
||||||
if result[1]: # stderr
|
if result[1]: # stderr
|
||||||
|
Loading…
Reference in New Issue
Block a user