class documentation

class GlusterVolume(object):

View In Hierarchy

This class represents a Gluster volume.

Volumes are uniquely identified by:

  • their IP address
  • their port
  • the volume name itself

Two GlusterVolume objects x, y with same IP address, port and volume name are considered equal.

Method __eq__ Undocumented
Method __hash__ Undocumented
Method __init__ Creates a Gluster volume object.
Method __repr__ Undocumented
Method GetKVMMountString Return the string KVM needs to use this volume.
Method Mount Try and mount the volume. No-op if the volume is already mounted.
Method Unmount Try and unmount the volume.
Instance Variable mount_point Undocumented
Instance Variable server_addr Undocumented
Property port Undocumented
Property server_ip Undocumented
Property volume Undocumented
Method _GetFUSEMountString Return the string FUSE needs to mount this volume.
Method _GuessMountFailReasons Try and give reasons why the mount might've failed.
Method _IsMounted Checks if we are mounted or not.
Instance Variable _port Undocumented
Instance Variable _run_cmd Undocumented
Instance Variable _server_ip Undocumented
Instance Variable _volume Undocumented
def __eq__(self, other):

Undocumented

def __hash__(self):

Undocumented

def __init__(self, server_addr, port, volume, _run_cmd=utils.RunCmd, _mount_point=None):

Creates a Gluster volume object.

Parameters
server_addr:strThe address to connect to
port:intThe port to connect to (Gluster standard is 24007)
volume:strThe gluster volume to use for storage.
_run_cmdUndocumented
_mount_pointUndocumented
def __repr__(self):

Undocumented

def GetKVMMountString(self, path):

Return the string KVM needs to use this volume.

Returns
strUndocumented
def Mount(self):

Try and mount the volume. No-op if the volume is already mounted.

Returns
context manager

A simple context manager that lets you use this volume for short lived operations like so:

 with volume.mount():
   # Do operations on volume
 # Volume is now unmounted
Raises
BlockDeviceErrorif the mount was unsuccessful
def Unmount(self):

Try and unmount the volume.

Failures are logged but otherwise ignored.

Raises
BlockDeviceErrorif the volume was not mounted to begin with.
mount_point =

Undocumented

server_addr =

Undocumented

@property
port =

Undocumented

@property
server_ip =

Undocumented

@property
volume =

Undocumented

def _GetFUSEMountString(self):

Return the string FUSE needs to mount this volume.

Returns
strUndocumented
def _GuessMountFailReasons(self):

Try and give reasons why the mount might've failed.

Returns
strA semicolon-separated list of problems found with the current setup suitable for display to the user.
def _IsMounted(self):

Checks if we are mounted or not.

Returns
boolTrue if this volume is mounted.
_port =

Undocumented

_run_cmd =

Undocumented

_server_ip =

Undocumented

_volume =

Undocumented