summaryrefslogtreecommitdiffstats
path: root/src/com.gluster.storage.management.gateway/WebContent/scripts/grun.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/com.gluster.storage.management.gateway/WebContent/scripts/grun.py')
-rwxr-xr-xsrc/com.gluster.storage.management.gateway/WebContent/scripts/grun.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/com.gluster.storage.management.gateway/WebContent/scripts/grun.py b/src/com.gluster.storage.management.gateway/WebContent/scripts/grun.py
index e09ef5bc..cc00f466 100755
--- a/src/com.gluster.storage.management.gateway/WebContent/scripts/grun.py
+++ b/src/com.gluster.storage.management.gateway/WebContent/scripts/grun.py
@@ -33,13 +33,15 @@ def main():
fp.close()
except IOError, e:
Utils.log("Failed to read server file %s: %s\n" % (serverFile, str(e)))
+ sys.stderr.write("Failed to read server file %s: %s\n" % (serverFile, str(e)))
sys.exit(1)
status = True
for serverName in serverNameList:
- rv = Utils.runCommand(sshCommandPrefix + [serverName.strip()] + command)
- print "%s: %s" % (serverName, rv)
- if rv != 0:
+ rv = Utils.runCommand(sshCommandPrefix + [serverName.strip()] + command, output=True)
+ if rv["Status"] != 0:
+ sys.stderr.write("%s: %s\nStdout:\n%s\nStderr:%s\n---\n" \
+ % (serverName, rv["Status"], rv["Stdout"], rv["Stderr"]))
status = False
if status: