Package ganeti :: Package storage :: Module gluster :: Class GlusterVolume
[hide private]
[frames] | no frames]

Class GlusterVolume

source code


This class represents a Gluster volume.

Volumes are uniquely identified by:

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

Instance Methods [hide private]
 
__init__(self, server_addr, port, volume, _run_cmd=utils.RunCmd, _mount_point=None)
Creates a Gluster volume object.
source code
 
server_ip(self) source code
 
port(self) source code
 
volume(self) source code
 
__eq__(self, other) source code
 
__repr__(self)
repr(x)
source code
 
__hash__(self)
hash(x)
source code
bool
_IsMounted(self)
Checks if we are mounted or not.
source code
str
_GuessMountFailReasons(self)
Try and give reasons why the mount might've failed.
source code
str
_GetFUSEMountString(self)
Return the string FUSE needs to mount this volume.
source code
str
GetKVMMountString(self, path)
Return the string KVM needs to use this volume.
source code
context manager
Mount(self)
Try and mount the volume.
source code
 
Unmount(self)
Try and unmount the volume.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

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

source code 

Creates a Gluster volume object.

Parameters:
  • server_addr (str) - The address to connect to
  • port (int) - The port to connect to (Gluster standard is 24007)
  • volume (str) - The gluster volume to use for storage.
Overrides: object.__init__

server_ip(self)

source code 
Decorators:
  • @property

port(self)

source code 
Decorators:
  • @property

volume(self)

source code 
Decorators:
  • @property

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__hash__(self)
(Hashing function)

source code 

hash(x)

Overrides: object.__hash__
(inherited documentation)

_IsMounted(self)

source code 

Checks if we are mounted or not.

Returns: bool
True if this volume is mounted.

_GuessMountFailReasons(self)

source code 

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

Returns: str
A semicolon-separated list of problems found with the current setup suitable for display to the user.

Mount(self)

source code 

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:

Unmount(self)

source code 

Try and unmount the volume.

Failures are logged but otherwise ignored.

Raises: