diff options
author | ShwethaHP <spandura@redhat.com> | 2017-08-31 16:03:59 +0530 |
---|---|---|
committer | ShwethaHP <spandura@redhat.com> | 2017-08-31 16:11:46 +0530 |
commit | c16e9a6f88e2984718e01ee6c7b62c615f7d5913 (patch) | |
tree | 1e1a311c516fec6d605fb925812480ad3d566f4f /glustolibs-gluster/glustolibs/gluster/mount_ops.py | |
parent | dfe392e04ee3a126fad2a9b3b5c526f7f7594cf5 (diff) |
Making mounting of volume optional in the BaseClass.
Mounting of a volume will not always be distributed volume. Providing a option to mount a local
volume as well.
Change-Id: Iadbb596fba7e2a5fa4ba3ba53967961a70d00c8c
Signed-off-by: ShwethaHP <spandura@redhat.com>
Diffstat (limited to 'glustolibs-gluster/glustolibs/gluster/mount_ops.py')
-rw-r--r-- | glustolibs-gluster/glustolibs/gluster/mount_ops.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/mount_ops.py b/glustolibs-gluster/glustolibs/gluster/mount_ops.py index adb3cae9f..10d323a62 100644 --- a/glustolibs-gluster/glustolibs/gluster/mount_ops.py +++ b/glustolibs-gluster/glustolibs/gluster/mount_ops.py @@ -109,7 +109,9 @@ class GlusterMount(): self.mountpoint = "/mnt/%s" % self.mounttype # Get server - self.server_system = mount['server'] + self.server_system = None + if 'server' in mount and mount['server']: + self.server_system = mount['server'] # Get client self.client_system = mount['client']['host'] @@ -342,8 +344,12 @@ def mount_volume(volname, mtype, mpoint, mserver, mclient, options='', elif options and 'vers' not in options: options = options + ",vers=3" - mcmd = ("mount -t %s %s %s:/%s %s" % - (mtype, options, mserver, volname, mpoint)) + if mserver: + mcmd = ("mount -t %s %s %s:/%s %s" % + (mtype, options, mserver, volname, mpoint)) + else: + mcmd = ("mount -t %s %s %s %s" % + (mtype, options, volname, mpoint)) if mtype == 'cifs': if smbuser is None or smbpasswd is None: |