diff options
Diffstat (limited to 'glustolibs-gluster/glustolibs/gluster/mount_ops.py')
-rwxr-xr-x | glustolibs-gluster/glustolibs/gluster/mount_ops.py | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/mount_ops.py b/glustolibs-gluster/glustolibs/gluster/mount_ops.py index c41ef8528..02dc0a253 100755 --- a/glustolibs-gluster/glustolibs/gluster/mount_ops.py +++ b/glustolibs-gluster/glustolibs/gluster/mount_ops.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# Copyright (C) 2015-2016 Red Hat, Inc. <http://www.redhat.com> +# Copyright (C) 2015-2020 Red Hat, Inc. <http://www.redhat.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -356,23 +356,10 @@ def mount_volume(volname, mtype, mpoint, mserver, mclient, options='', # 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 occurred while getting the platform " - "of node %s: %s", mclient, str(e)) - return (1, '', '') - finally: - g.rpyc_close_connection(host=mclient, user=user) - + cmd = "cat /etc/redhat-release | grep Santiago" + ret, _, _ = g.run(mclient, cmd, user=user) + if not ret: + cifs_options = "sec=ntlmssp" mcmd = ("mount -t cifs -o username=%s,password=%s,%s " "\\\\\\\\%s\\\\gluster-%s %s" % (smbuser, smbpasswd, cifs_options, mserver, |