Trees | Indices | Help |
|
---|
|
Module containing utilities for virtual clusters.
Most functions manipulate file system paths and are no-ops when the
environment variables GANETI_ROOTDIR
and
GANETI_HOSTNAME
are not set. See the functions' docstrings
for details.
|
|||
string |
|
||
string |
|
||
|
|||
tuple; (string, string, string or None) |
|
||
string or None
|
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Imports: os, compat, _constants
|
Retrieves root directory from an environment variable.
|
Retrieves virtual hostname from an environment variable.
|
Very basic check for hostnames.
|
Checks if the root directory and hostname are acceptable. The (node-specific) root directory must have the hostname as its last component. The parent directory then becomes the cluster-wide root directory. This is necessary as some components must be able to predict the root path on a remote node (e.g. copying files via scp).
|
Replaces the node-specific root directory in a path. Replaces it with the root directory for another node. Assuming
|
Adds a node-specific prefix to a path in a virtual cluster. Returned path includes user-specified root directory if specified in
environment. As an example, the path |
Removes the node-specific prefix from a path. This is the opposite of AddNodePrefix and removes a node-local prefix path. |
Virtualizes a path. A path is "virtualized" by stripping it of its node-specific directory and prepending a prefix (_VIRT_PATH_PREFIX). Use LocalizeVirtualPath to undo the process. Virtual paths are meant to be transported via RPC. |
Localizes a virtual path. A "virtualized" path consists of a prefix (LocalizeVirtualPath) and a local path. This function adds the node-specific directory to the local path. Virtual paths are meant to be transported via RPC. |
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Jan 12 17:28:41 2016 | http://epydoc.sourceforge.net |