distaflibs.gluster.mount_ops module

class distaflibs.gluster.mount_ops.GlusterMount(mount)

Gluster Mount class

Parameters:mount (dict) – Mount dict with ‘mount_protocol’, ‘mountpoint’, ‘server’, ‘client’, ‘volname’, ‘options’ as keys
Returns:Instance of GlusterMount class
client_register = 0
mount()

Mounts the volume

Parameters:instance args passed at init (uses) –
Returns:True on success and False on failure.
Return type:bool
is_mounted()

Tests for mount on client

Parameters:instance args passed at init (uses) –
Returns:True on success and False on failure.
Return type:bool
unmount()

Unmounts the volume

Parameters:instance args passed at init (uses) –
Returns:True on success and False on failure.
Return type:bool
distaflibs.gluster.mount_ops.is_mounted(volname, mpoint, mserver, mclient)

Check if mount exist.

Parameters:
  • volname (str) – Name of the volume
  • mpoint (str) – Mountpoint dir
  • mserver (str) – Server to which it is mounted to
  • mclient (str) – Client from which it is mounted.
Returns:

True if mounted and False otherwise.

Return type:

bool

distaflibs.gluster.mount_ops.mount_volume(volname, mtype='glusterfs', mpoint='/mnt/glusterfs', mserver='', mclient='', options='')

Mount the gluster volume with specified options.

Parameters:volname (str) – Name of the volume to mount.
Kwargs:
mtype (str): Protocol to be used to mount. mpoint (str): Mountpoint dir. mserver (str): Server to mount. mclient (str): Client from which it has to be mounted. option (str): Options for the mount command.
Returns:Tuple containing three elements (ret, out, err). (0, ‘’, ‘’) if already mounted. (1, ‘’, ‘’) if setup_samba_service fails in case of smb. (ret, out, err) of mount commnd execution otherwise.
Return type:tuple
distaflibs.gluster.mount_ops.umount_volume(mclient, mpoint)

Unmounts the mountpoint.

Parameters:
  • mclient (str) – Client from which it has to be mounted.
  • mpoint (str) – Mountpoint dir.
Returns:

Tuple containing three elements (ret, out, err) as returned by umount command execution.

Return type:

tuple