summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShwetha Panduranga <spandura@redhat.com>2016-06-27 01:49:15 +0530
committerRaghavendra Talur <rtalur@redhat.com>2016-06-26 21:41:00 -0700
commit7897e023e60f8cdfa6d7a5ea654214ad186dd033 (patch)
tree3052e49345c18d382949e58116ee6a303e890779
parentd2842f1b58ed31a45f9fb69efa4f4c7ae5ffd984 (diff)
Servers in yaml file is list of dicts. Hence iterating through servers to get
the 'host' of it. Change-Id: I361aa88ad21ce30fd57f297795c5f7ff60ccfd2a BUG: 1350256 Signed-off-by: Shwetha Panduranga <spandura@redhat.com> Reviewed-on: http://review.gluster.org/14805 Tested-by: ShwethaHPanduranga NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
-rw-r--r--tests/distaf/distaf_libs/distaflibs-gluster/distaflibs/gluster/ctdb_libs.py50
1 files changed, 47 insertions, 3 deletions
diff --git a/tests/distaf/distaf_libs/distaflibs-gluster/distaflibs/gluster/ctdb_libs.py b/tests/distaf/distaf_libs/distaflibs-gluster/distaflibs/gluster/ctdb_libs.py
index ea3b9c5af7f..0e4571a706c 100644
--- a/tests/distaf/distaf_libs/distaflibs-gluster/distaflibs/gluster/ctdb_libs.py
+++ b/tests/distaf/distaf_libs/distaflibs-gluster/distaflibs/gluster/ctdb_libs.py
@@ -41,6 +41,10 @@ def ctdb_firewall_settings(servers=None):
servers = tc.global_config['cluster_config']['smb']['ctdb_servers']
if not isinstance(servers, list):
servers = [servers]
+ server_host_list = []
+ for server in servers:
+ server_host_list.append(server['host'])
+ servers = server_host_list
_rc = True
for server in servers:
ret, out, _ = tc.run(server, "cat /etc/redhat-release")
@@ -98,6 +102,10 @@ def update_smb_conf(servers=None):
file_path = "/etc/samba/smb.conf"
if not isinstance(servers, list):
servers = [servers]
+ server_host_list = []
+ for server in servers:
+ server_host_list.append(server['host'])
+ servers = server_host_list
_rc = True
for server in servers:
ret, _, _ = tc.run(server, "grep 'clustering=yes' %s" % file_path)
@@ -129,6 +137,10 @@ def update_hook_scripts(servers=None):
if servers is None:
servers = (tc.global_config['gluster']['cluster_config']
['smb']['ctdb_servers'])
+ server_host_list = []
+ for server in servers:
+ server_host_list.append(server['host'])
+ servers = server_host_list
file1_path = "/var/lib/glusterd/hooks/1/start/post/S29CTDBsetup.sh"
file2_path = "/var/lib/glusterd/hooks/1/stop/pre/S29CTDB-teardown.sh"
_rc = True
@@ -160,6 +172,10 @@ def create_ctdb_nodes_file(servers=None):
if servers is None:
servers = (tc.global_config['gluster']['cluster_config']
['smb']['ctdb_servers'])
+ server_host_list = []
+ for server in servers:
+ server_host_list.append(server['host'])
+ servers = server_host_list
file_path = "/etc/ctdb/nodes"
_rc = True
ctdb_ips_list = []
@@ -202,10 +218,14 @@ def create_ctdb_meta_volume(mnode=None, servers=None, meta_volname=None):
'''
if mnode is None:
mnode = (tc.global_config['gluster']['cluster_config']
- ['smb']['ctdb_servers'][0])
+ ['smb']['ctdb_servers'][0]['host'])
if servers is None:
servers = (tc.global_config['gluster']['cluster_config']
['smb']['ctdb_servers'])
+ server_host_list = []
+ for server in servers:
+ server_host_list.append(server['host'])
+ servers = server_host_list
if meta_volname is None:
meta_volname = "ctdb"
replica_count = len(servers)
@@ -241,6 +261,10 @@ def check_if_gluster_lock_mount_exists(servers=None):
if servers is None:
servers = (tc.global_config['gluster']['cluster_config']
['smb']['ctdb_servers'])
+ server_host_list = []
+ for server in servers:
+ server_host_list.append(server['host'])
+ servers = server_host_list
if not isinstance(servers, list):
servers = [servers]
_rc = True
@@ -268,6 +292,10 @@ def check_if_ctdb_file_exists(servers=None):
if servers is None:
servers = (tc.global_config['gluster']['cluster_config']
['smb']['ctdb_servers'])
+ server_host_list = []
+ for server in servers:
+ server_host_list.append(server['host'])
+ servers = server_host_list
file_path = "/etc/sysconfig/ctdb"
if not isinstance(servers, list):
servers = [servers]
@@ -298,6 +326,10 @@ def create_ctdb_public_addresses(servers=None):
if servers is None:
servers = (tc.global_config['gluster']['cluster_config']
['smb']['ctdb_servers'])
+ server_host_list = []
+ for server in servers:
+ server_host_list.append(server['host'])
+ servers = server_host_list
ctdb_vips = (tc.global_config['gluster']['cluster_config']
['smb']['ctdb_vips'])
if not isinstance(servers, list):
@@ -337,6 +369,10 @@ def start_ctdb_service(servers=None):
if servers is None:
servers = (tc.global_config['gluster']['cluster_config']
['smb']['ctdb_servers'])
+ server_host_list = []
+ for server in servers:
+ server_host_list.append(server['host'])
+ servers = server_host_list
if not isinstance(servers, list):
servers = [servers]
_rc = True
@@ -363,7 +399,7 @@ def verify_ctdb_status(mnode=None):
'''
if mnode is None:
mnode = (tc.global_config['gluster']['cluster_config']
- ['smb']['ctdb_servers'][0])
+ ['smb']['ctdb_servers'][0]['host'])
_rc = True
ret, out, _ = tc.run(mnode, "cat /etc/ctdb/nodes")
if ret != 0:
@@ -404,10 +440,14 @@ def ctdb_gluster_setup(mnode=None, servers=None, meta_volname=None):
'''
if mnode is None:
mnode = (tc.global_config['gluster']['cluster_config']
- ['smb']['ctdb_servers'][0])
+ ['smb']['ctdb_servers'][0]['host'])
if servers is None:
servers = (tc.global_config['gluster']['cluster_config']
['smb']['ctdb_servers'])
+ server_host_list = []
+ for server in servers:
+ server_host_list.append(server['host'])
+ servers = server_host_list
if not isinstance(servers, list):
servers = [servers]
no_of_ctdb_servers = len(servers)
@@ -530,6 +570,10 @@ def stop_ctdb_service(servers=None):
if servers is None:
servers = (tc.global_config['gluster']['cluster_config']
['smb']['ctdb_servers'])
+ server_host_list = []
+ for server in servers:
+ server_host_list.append(server['host'])
+ servers = server_host_list
if not isinstance(servers, list):
servers = [servers]
_rc = True