Browse Source

Merge branch 'master' into 'master'

ffpb.py: check if exec-on-peer returning data or not and display correct content in irc channel
Helge Jung 10 years ago
parent
commit
7cb620e640
1 changed files with 6 additions and 2 deletions
  1. 6 2
      modules/ffpb.py

+ 6 - 2
modules/ffpb.py

@@ -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)
-