From 9c5e828e51ca14ec5151a629175ed95cce0106fe Mon Sep 17 00:00:00 2001 From: ShwethaHP Date: Thu, 23 Nov 2017 02:29:35 +0530 Subject: Adding a cifs security option while mouting if the client is rhel6 Change-Id: Ifc6aa4d106dadf97e1741ec54a3323ea96e33101 Signed-off-by: ShwethaHP --- glustolibs-gluster/glustolibs/gluster/mount_ops.py | 24 ++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'glustolibs-gluster/glustolibs/gluster') diff --git a/glustolibs-gluster/glustolibs/gluster/mount_ops.py b/glustolibs-gluster/glustolibs/gluster/mount_ops.py index 10d323a62..c0c7cc08e 100644 --- a/glustolibs-gluster/glustolibs/gluster/mount_ops.py +++ b/glustolibs-gluster/glustolibs/gluster/mount_ops.py @@ -357,8 +357,28 @@ def mount_volume(volname, mtype, mpoint, mserver, mclient, options='', "for cifs mounts") return (1, '', '') - mcmd = ("mount -t cifs -o username=%s,password=%s " - "\\\\\\\\%s\\\\gluster-%s %s" % (smbuser, smbpasswd, mserver, + # Check if client is running rhel. If so add specific options + cifs_options = "" + try: + conn = g.rpyc_get_connection(mclient, user=user) + if conn is None: + g.log.error("Unable to get connection to %s on node %s" + " in mount_volume()", user, mclient) + return (1, '', '') + + os, version, name = conn.modules.platform.linux_distribution() + if "Santiago" in name: + cifs_options = "sec=ntlmssp" + except Exception as e: + g.log.error("Exception occured while getting the platform " + "of node %s: %s", mclient, str(e)) + return (1, '', '') + finally: + g.rpyc_close_connection(host=mclient, user=user) + + mcmd = ("mount -t cifs -o username=%s,password=%s,%s " + "\\\\\\\\%s\\\\gluster-%s %s" % (smbuser, smbpasswd, + cifs_options, mserver, volname, mpoint)) # Create mount dir -- cgit