ffpb.py: check if exec-on-peer returning data or not and display correct content in irc channel
@@ -158,10 +158,14 @@ def ffpb_remoteexec(bot, trigger):
try:
result = subprocess.check_output(['ssh', '-6n', '-l', 'root', '-o', 'BatchMode=yes', '-o','StrictHostKeyChecking=no', target, target_cmd], stderr=subprocess.STDOUT, shell=False)
lines = str(result).splitlines()
+
+ if len(lines) == 0:
+ bot.say('exec-on-peer(' + target_name + '): No output')
+ return
bot.say('exec-on-peer(' + target_name + '): ' + str(len(lines)) + ' Zeilen (zeige max. 8):')
for line in lines[0:8]:
bot.say(line)
-
except subprocess.CalledProcessError, e:
bot.say('Fehler '+str(e.returncode)+' bei exec-on-peer('+target_name+'): ' + e.output)