diff options
Diffstat (limited to 'Libraries/GlusterCommands/ATFGlusterPeer.py')
-rwxr-xr-x | Libraries/GlusterCommands/ATFGlusterPeer.py | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Libraries/GlusterCommands/ATFGlusterPeer.py b/Libraries/GlusterCommands/ATFGlusterPeer.py new file mode 100755 index 0000000..9e40f50 --- /dev/null +++ b/Libraries/GlusterCommands/ATFGlusterPeer.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python +import ATFUtils +import ATFTestEnv + +def probe(): + """ + Description: + probe peer specified by <HOSTNAME> + + Parameters: + None + + Returns: + Success: 0 + Failure: 1 + """ + + command = "gluster peer probe " + servers = ATFUtils.TestEnvObj.get_servershostlist() + + length = len(servers) + if (length == 1): + ATFUtils.Logger.warning("Self Probing of Server Not Required") + return 0 + else: + fromhost = servers.pop(0) + for host in servers: + command = command + host + " " + + status, stdin, stdout, stderr = ATFUtils.execute_command(command, + host=fromhost, + user='root') + + if (status == 1): + return 1 + else: + return ATFUtils.parse_output(stdout, stderr) + |