class documentation
class GlusterVolume(object):
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 | |
Return the string KVM needs to use this volume. |
| Method | |
Try and mount the volume. No-op if the volume is already mounted. |
| Method | |
Try and unmount the volume. |
| Instance Variable | mount |
Undocumented |
| Instance Variable | server |
Undocumented |
| Property | port |
Undocumented |
| Property | server |
Undocumented |
| Property | volume |
Undocumented |
| Method | _ |
Return the string FUSE needs to mount this volume. |
| Method | _ |
Try and give reasons why the mount might've failed. |
| Method | _ |
Checks if we are mounted or not. |
| Instance Variable | _port |
Undocumented |
| Instance Variable | _run |
Undocumented |
| Instance Variable | _server |
Undocumented |
| Instance Variable | _volume |
Undocumented |
Creates a Gluster volume object.
| Parameters | |
| server | 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. |
| _run | Undocumented |
| _mount | Undocumented |
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 | |
BlockDeviceError | if the mount was unsuccessful |
Try and unmount the volume.
Failures are logged but otherwise ignored.
| Raises | |
BlockDeviceError | if the volume was not mounted to begin with. |