|
@@ -531,13 +531,12 @@ def ffpb_rolloutstatus(bot, trigger):
|
|
|
if skipped > 0:
|
|
|
bot.say("Rollout von '{0}': {1} Knoten unklar".format(expected_release, skipped))
|
|
|
|
|
|
-
|
|
|
@willie.module.commands('ping')
|
|
|
-def ffpb_ping(bot, trigger):
|
|
|
+def ffpb_ping(bot, trigger=None, target_name=None):
|
|
|
"""Ping FFPB-Knoten"""
|
|
|
- target_name = trigger.group(2)
|
|
|
+ if target_name is None: target_name = trigger.group(2)
|
|
|
node = ffpb_findnode_from_botparam(bot, target_name, ensure_recent_alfreddata=False)
|
|
|
- if node is None: return
|
|
|
+ if node is None: return None
|
|
|
|
|
|
target = [x for x in node["network"]["addresses"] if not x.lower().startswith("fe80:")][0]
|
|
|
target_alias = node["hostname"]
|
|
@@ -545,11 +544,14 @@ def ffpb_ping(bot, trigger):
|
|
|
print("ping '", target , '"', sep='')
|
|
|
result = os.system('ping6 -c 2 -W 1 ' + target + ' 2>/dev/null')
|
|
|
if result == 0:
|
|
|
- bot.say('Knoten "' + target_alias + '" antwortet \o/')
|
|
|
+ if not bot is None: bot.say('Knoten "' + target_alias + '" antwortet \o/')
|
|
|
+ return True
|
|
|
elif result == 1 or result == 256:
|
|
|
- bot.say('Keine Antwort von "' + target_alias + '" :-(')
|
|
|
+ if not bot is None: bot.say('Keine Antwort von "' + target_alias + '" :-(')
|
|
|
+ return False
|
|
|
else:
|
|
|
- bot.say('Uh oh, irgendwas ist kaputt. Chef, ping result = ' + str(result) + ' - darf ich das essen?')
|
|
|
+ if not bot is None: bot.say('Uh oh, irgendwas ist kaputt. Chef, ping result = ' + str(result) + ' - darf ich das essen?')
|
|
|
+ return None
|
|
|
|
|
|
@willie.module.commands('exec-on-peer')
|
|
|
def ffpb_remoteexec(bot, trigger):
|