From cc1a36474c26c98ed93da003a274d58204c79e00 Mon Sep 17 00:00:00 2001 From: Arthy Loganathan Date: Wed, 24 May 2017 11:36:09 +0530 Subject: Minor changes in gluster base class wrt nfs-ganesha Change-Id: Iaceb22cd5b2fe920c9cdc6d110d26939e26e5ffe Signed-off-by: Arthy Loganathan --- glustolibs-gluster/glustolibs/gluster/gluster_base_class.py | 9 ++++++++- glustolibs-gluster/glustolibs/gluster/mount_ops.py | 10 +++++----- 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'glustolibs-gluster') diff --git a/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py b/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py index 4ad6cc732..777f9eaf5 100644 --- a/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py +++ b/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py @@ -126,12 +126,19 @@ class GlusterBaseClass(unittest.TestCase): cls.smb_users_info['root']['password'] = 'foobar' cls.smb_users_info['root']['acl'] = 'rwx' - # NFS-Ganesha Cluster Info + # NFS-Ganesha Cluster info try: cls.enable_nfs_ganesha = bool(g.config['gluster']['cluster_config'] ['nfs_ganesha']['enable']) + cls.num_of_nfs_ganesha_nodes = (g.config['gluster'] + ['cluster_config']['nfs_ganesha'] + ['num_of_nfs_ganesha_nodes']) + cls.vips = (g.config['gluster']['cluster_config']['nfs_ganesha'] + ['vips']) except KeyError: cls.enable_nfs_ganesha = False + cls.num_of_nfs_ganesha_nodes = None + cls.vips = [] # Defining default volume_types configuration. default_volume_type_config = { diff --git a/glustolibs-gluster/glustolibs/gluster/mount_ops.py b/glustolibs-gluster/glustolibs/gluster/mount_ops.py index 1a697866e..adb3cae9f 100644 --- a/glustolibs-gluster/glustolibs/gluster/mount_ops.py +++ b/glustolibs-gluster/glustolibs/gluster/mount_ops.py @@ -396,7 +396,7 @@ def create_mount_objs(mounts): Example: mounts: [ - {'mount_protocol': 'glusterfs', + {'protocol': 'glusterfs', 'mountpoint': '/mnt/g1', 'server': 'abc.lab.eng.xyz.com', 'client': {'host': 'def.lab.eng.xyz.com'}, @@ -404,14 +404,14 @@ def create_mount_objs(mounts): 'options': '', 'num_of_mounts': 2}, - {'mount_protocol': 'nfs', + {'protocol': 'nfs', 'mountpoint': '/mnt/n1', 'server': 'abc.lab.eng.xyz.com', 'client': {'host': 'def.lab.eng.xyz.com'}, 'volname': 'testvoi', 'options': ''} - {'mount_protocol': 'smb', + {'protocol': 'smb', 'mountpoint': '', 'server': 'abc.lab.eng.xyz.com', 'client': { @@ -435,14 +435,14 @@ def create_mount_objs(mounts): temp_mount = copy.deepcopy(mount) if (mount['protocol'] == "glusterfs" or mount['protocol'] == "nfs" or mount['protocol'] == "cifs"): - if 'mountpoint' in mount['mountpoint'] and mount['mountpoint']: + if 'mountpoint' in mount and mount['mountpoint']: temp_mount['mountpoint'] = mount['mountpoint'] else: temp_mount['mountpoint'] = ("/mnt/%s_%s" % (mount['volname'], mount['protocol'])) elif mount['protocol'] == "smb": - if 'mountpoint' in mount['mountpoint'] and mount['mountpoint']: + if 'mountpoint' in mount and mount['mountpoint']: temp_mount['mountpoint'] = mount['mountpoint'] else: temp_mount['mountpoint'] = "*" -- cgit