diff options
Diffstat (limited to 'src/com.gluster.storage.management.gateway/WebContent/scripts')
9 files changed, 5 insertions, 18 deletions
diff --git a/src/com.gluster.storage.management.gateway/WebContent/scripts/Utils.py b/src/com.gluster.storage.management.gateway/WebContent/scripts/Utils.py index bcc6f177..82f8b7b6 100644 --- a/src/com.gluster.storage.management.gateway/WebContent/scripts/Utils.py +++ b/src/com.gluster.storage.management.gateway/WebContent/scripts/Utils.py @@ -1059,8 +1059,6 @@ def log(priority, message=None): def stripEmptyLines(content): - if not content: - return "" ret = "" for line in content.split("\n"): if line.strip() != "": diff --git a/src/com.gluster.storage.management.gateway/WebContent/scripts/add_user_cifs_all.py b/src/com.gluster.storage.management.gateway/WebContent/scripts/add_user_cifs_all.py index b9fcaf6d..f1e899ec 100755 --- a/src/com.gluster.storage.management.gateway/WebContent/scripts/add_user_cifs_all.py +++ b/src/com.gluster.storage.management.gateway/WebContent/scripts/add_user_cifs_all.py @@ -87,7 +87,6 @@ def main(): if rv == 0: if not setUid(uid, userName): - sys.stderr.write("Failed to update user uid\n") sys.exit(11) sys.exit(rv) diff --git a/src/com.gluster.storage.management.gateway/WebContent/scripts/create_volume_cifs_all.py b/src/com.gluster.storage.management.gateway/WebContent/scripts/create_volume_cifs_all.py index b327580c..80b6da7c 100755 --- a/src/com.gluster.storage.management.gateway/WebContent/scripts/create_volume_cifs_all.py +++ b/src/com.gluster.storage.management.gateway/WebContent/scripts/create_volume_cifs_all.py @@ -51,7 +51,6 @@ def main(): rv = Utils.runCommand(["grun.py", serverFile, "create_volume_cifs.py", volumeName] + userList) if rv == 0: if not addVolumeCifsConf(volumeName, userList): - sys.stderr.write("Unable to update volume cifs configuration\n") sys.exit(11) sys.exit(rv) diff --git a/src/com.gluster.storage.management.gateway/WebContent/scripts/delete_user_cifs_all.py b/src/com.gluster.storage.management.gateway/WebContent/scripts/delete_user_cifs_all.py index a6bf15dc..d414fc2c 100755 --- a/src/com.gluster.storage.management.gateway/WebContent/scripts/delete_user_cifs_all.py +++ b/src/com.gluster.storage.management.gateway/WebContent/scripts/delete_user_cifs_all.py @@ -51,7 +51,6 @@ def main(): rv = Utils.runCommand("grun.py %s delete_user_cifs.py %s" % (serverList, userName)) if rv == 0: if not removeUser(userName): - sys.stderr.write("Failed to remove user\n") sys.exit(10) sys.exit(rv) diff --git a/src/com.gluster.storage.management.gateway/WebContent/scripts/delete_volume_cifs_all.py b/src/com.gluster.storage.management.gateway/WebContent/scripts/delete_volume_cifs_all.py index 2e2b8db3..b41e3d65 100755 --- a/src/com.gluster.storage.management.gateway/WebContent/scripts/delete_volume_cifs_all.py +++ b/src/com.gluster.storage.management.gateway/WebContent/scripts/delete_volume_cifs_all.py @@ -49,7 +49,6 @@ def main(): rv = Utils.runCommand(["grun.py", serverFile, "delete_volume_cifs.py", volumeName]) if rv == 0: if not removeVolumeCifsConf(volumeName): - sys.stderr.write("Failed to remove volume cifs config file\n") sys.exit(11) sys.exit(rv) diff --git a/src/com.gluster.storage.management.gateway/WebContent/scripts/get_volume_user_cifs.py b/src/com.gluster.storage.management.gateway/WebContent/scripts/get_volume_user_cifs.py index 33de3bf1..55821b60 100755 --- a/src/com.gluster.storage.management.gateway/WebContent/scripts/get_volume_user_cifs.py +++ b/src/com.gluster.storage.management.gateway/WebContent/scripts/get_volume_user_cifs.py @@ -40,7 +40,6 @@ def main(): sys.exit(0) except IOError, e: Utils.log("failed to read file %s: %s" % (cifsVolumeFile, str(e))) - sys.stderr.write("Failed to read cifs-volume-file %s: %s\n" % (cifsVolumeFile, str(e))) sys.exit(2) 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 cc00f466..e09ef5bc 100755 --- a/src/com.gluster.storage.management.gateway/WebContent/scripts/grun.py +++ b/src/com.gluster.storage.management.gateway/WebContent/scripts/grun.py @@ -33,15 +33,13 @@ 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, 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"])) + rv = Utils.runCommand(sshCommandPrefix + [serverName.strip()] + command) + print "%s: %s" % (serverName, rv) + if rv != 0: status = False if status: diff --git a/src/com.gluster.storage.management.gateway/WebContent/scripts/setup_cifs_config_all.py b/src/com.gluster.storage.management.gateway/WebContent/scripts/setup_cifs_config_all.py index 657f05f7..8dd59c8c 100755 --- a/src/com.gluster.storage.management.gateway/WebContent/scripts/setup_cifs_config_all.py +++ b/src/com.gluster.storage.management.gateway/WebContent/scripts/setup_cifs_config_all.py @@ -21,11 +21,8 @@ def main(): serverFile = sys.argv[1] - rv = Utils.runCommand(["grun.py", serverFile, "setup_cifs_config.py"], output=True) - if status["Status"] != 0: - sys.stderr.write("%s %s\n" % (Utils.stripEmptyLines(rv["Stderr"]), Utils.stripEmptyLines(rv["Stdout"]))) - sys.exit(-1) - sys.exit(0) + rv = Utils.runCommand(["grun.py", serverFile, "setup_cifs_config.py"]) + sys.exit(rv) if __name__ == "__main__": diff --git a/src/com.gluster.storage.management.gateway/WebContent/scripts/update_volume_cifs_all.py b/src/com.gluster.storage.management.gateway/WebContent/scripts/update_volume_cifs_all.py index e2ea9ac2..a4d424b3 100755 --- a/src/com.gluster.storage.management.gateway/WebContent/scripts/update_volume_cifs_all.py +++ b/src/com.gluster.storage.management.gateway/WebContent/scripts/update_volume_cifs_all.py @@ -52,7 +52,6 @@ def main(): rv = Utils.runCommand(["grun.py", serverFile, "update_volume_cifs.py", volumeName] + userList) if rv == 0: if not updateVolumeCifsConf(volumeName, userList): - sys.stderr.write("Unable to update volume cifs configuration\n") sys.exit(11) sys.exit(rv) |
