|
@@ -916,7 +916,7 @@ def ffpb_rolloutstatus(bot, trigger):
|
|
|
bot.say('plus {0} Knoten deren Status gerade nicht abfragbar war'.format(skipped))
|
|
|
|
|
|
@willie.module.commands('ping')
|
|
|
-def ffpb_ping(bot, trigger=None, target_name=None):
|
|
|
+def ffpb_ping(bot, trigger=None, target_name=None, reply_directly=True):
|
|
|
"""Ping the given node"""
|
|
|
|
|
|
# identify node or bail out
|
|
@@ -933,15 +933,15 @@ def ffpb_ping(bot, trigger=None, target_name=None):
|
|
|
result = os.system('ping6 -c 2 -W 1 ' + target + ' >/dev/null')
|
|
|
if result == 0:
|
|
|
print("ping to '{0}' succeeded".format(target_name))
|
|
|
- if not bot is None: bot.say('Knoten "' + target_alias + '" antwortet \o/')
|
|
|
+ if reply_directly: bot.say('Knoten "' + target_alias + '" antwortet \o/')
|
|
|
return True
|
|
|
elif result == 1 or result == 256:
|
|
|
print("ping to '{0}' failed".format(target_name))
|
|
|
- if not bot is None: bot.say('Keine Antwort von "' + target_alias + '" :-(')
|
|
|
+ if reply_directly: bot.say('Keine Antwort von "' + target_alias + '" :-(')
|
|
|
return False
|
|
|
else:
|
|
|
print("ping to '{0}' broken: result='{1}'".format(target_name, result))
|
|
|
- if not bot is None: bot.say('Uh oh, irgendwas ist kaputt. Chef, ping result = ' + str(result) + ' - darf ich das essen?')
|
|
|
+ if reply_directly: bot.say('Uh oh, irgendwas ist kaputt. Chef, ping result = ' + str(result) + ' - darf ich das essen?')
|
|
|
return None
|
|
|
|
|
|
@willie.module.commands('providers')
|