CedarBackup3.config.OptionsConfig

Package CedarBackup3 :: Module config :: Class OptionsConfig |
[hide private]
[frames] | no frames]

# Class OptionsConfig

source code

    object --+
             |
            OptionsConfig

Class representing a Cedar Backup global options configuration.

The options section is used to store global configuration options and defaults that can be applied to other sections.

The following restrictions exist on data in this class:

- The working directory must be an absolute path.
- The starting day must be a day of the week in English, i.e. `"monday"`, `"tuesday"`, etc.
- All of the other values must be non-empty strings if they are set to something other than `None`.
- The overrides list must be a list of `CommandOverride` objects.
- The hooks list must be a list of `ActionHook` objects.
- The cback command must be a non-empty string.
- Any managed action name must be a non-empty string matching `ACTION_NAME_REGEX`

Instance Methods | [hide private]
__init__(self, startingDay=None, workingDir=None, backupUser=None, backupGroup=None, rcpCommand=None, overrides=None, hooks=None, rshCommand=None, cbackCommand=None, managedActions=None) Constructor for the `OptionsConfig` class. | source code
__repr__(self) Official string representation for class instance. | source code
__str__(self) Informal string representation for class instance. | source code
__cmp__(self, other) Original Python 2 comparison operator. | source code
__eq__(self, other) Equals operator, implemented in terms of original Python 2 compare operator. | source code
__lt__(self, other) Less-than operator, implemented in terms of original Python 2 compare operator. | source code
__gt__(self, other) Greater-than operator, implemented in terms of original Python 2 compare operator. | source code
addOverride(self, command, absolutePath) If no override currently exists for the command, add one. | source code
replaceOverride(self, command, absolutePath) If override currently exists for the command, replace it; otherwise add it. | source code
_setStartingDay(self, value) Property target used to set the starting day. | source code
_getStartingDay(self) Property target used to get the starting day. | source code
_setWorkingDir(self, value) Property target used to set the working directory. | source code
_getWorkingDir(self) Property target used to get the working directory. | source code
_setBackupUser(self, value) Property target used to set the backup user. | source code
_getBackupUser(self) Property target used to get the backup user. | source code
_setBackupGroup(self, value) Property target used to set the backup group. | source code
_getBackupGroup(self) Property target used to get the backup group. | source code
_setRcpCommand(self, value) Property target used to set the rcp command. | source code
_getRcpCommand(self) Property target used to get the rcp command. | source code
_setRshCommand(self, value) Property target used to set the rsh command. | source code
_getRshCommand(self) Property target used to get the rsh command. | source code
_setCbackCommand(self, value) Property target used to set the cback command. | source code
_getCbackCommand(self) Property target used to get the cback command. | source code
_setOverrides(self, value) Property target used to set the command path overrides list. | source code
_getOverrides(self) Property target used to get the command path overrides list. | source code
_setHooks(self, value) Property target used to set the pre- and post-action hooks list. | source code
_getHooks(self) Property target used to get the command path hooks list. | source code
_setManagedActions(self, value) Property target used to set the managed actions list. | source code
_getManagedActions(self) Property target used to get the managed actions list. | source code
__ge__(x, y) x>=y |
__le__(x, y) x<=y |
Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties | [hide private]
| startingDay Day that starts the week.
| workingDir Working (temporary) directory to use for backups.
| backupUser Effective user that backups should run as.
| backupGroup Effective group that backups should run as.
| rcpCommand Default rcp-compatible copy command for staging.
| rshCommand Default rsh-compatible command to use for remote shells.
| overrides List of configured command path overrides, if any.
| cbackCommand Default cback-compatible command to use on managed remote peers.
| hooks List of configured pre- and post-action hooks.
| managedActions Default set of actions that are managed on remote peers.
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, startingDay=None, workingDir=None, backupUser=None, backupGroup=None, rcpCommand=None, overrides=None, hooks=None, rshCommand=None, cbackCommand=None, managedActions=None) (Constructor) | source code
Constructor for the `OptionsConfig` class. Parameters: `startingDay` - Day that starts the week. `workingDir` - Working (temporary) directory to use for backups. `backupUser` - Effective user that backups should run as. `backupGroup` - Effective group that backups should run as. `rcpCommand` - Default rcp-compatible copy command for staging. `rshCommand` - Default rsh-compatible command to use for remote shells. `cbackCommand` - Default cback-compatible command to use on managed remote peers. `overrides` - List of configured command path overrides, if any. `hooks` - List of configured pre- and post-action hooks. `managedActions` - Default set of actions that are managed on remote peers. Raises: `ValueError` - If one of the values is invalid. Overrides: object.__init__

### __repr__(self) (Representation operator) | source code
Official string representation for class instance. Overrides: object.__repr__

### __str__(self) (Informal representation operator) | source code
Informal string representation for class instance. Overrides: object.__str__

### __cmp__(self, other) (Comparison operator) | source code
Original Python 2 comparison operator. Parameters: `other` - Other object to compare to. Returns: -1/0/1 depending on whether self is `<`, `=` or `>` other.

### addOverride(self, command, absolutePath) | source code
If no override currently exists for the command, add one. Parameters: `command` - Name of command to be overridden. `absolutePath` - Absolute path of the overrridden command.

### replaceOverride(self, command, absolutePath) | source code
If override currently exists for the command, replace it; otherwise add it. Parameters: `command` - Name of command to be overridden. `absolutePath` - Absolute path of the overrridden command.

### _setStartingDay(self, value) | source code
Property target used to set the starting day. If it is not `None`, the value must be a valid English day of the week, one of `"monday"`, `"tuesday"`, `"wednesday"`, etc. Raises: `ValueError` - If the value is not a valid day of the week.

### _setWorkingDir(self, value) | source code
Property target used to set the working directory. The value must be an absolute path if it is not `None`. It does not have to exist on disk at the time of assignment. Raises: `ValueError` - If the value is not an absolute path. `ValueError` - If the value cannot be encoded properly.

### _setBackupUser(self, value) | source code
Property target used to set the backup user. The value must be a non-empty string if it is not `None`. Raises: `ValueError` - If the value is an empty string.

### _setBackupGroup(self, value) | source code
Property target used to set the backup group. The value must be a non-empty string if it is not `None`. Raises: `ValueError` - If the value is an empty string.

### _setRcpCommand(self, value) | source code
Property target used to set the rcp command. The value must be a non-empty string if it is not `None`. Raises: `ValueError` - If the value is an empty string.

### _setRshCommand(self, value) | source code
Property target used to set the rsh command. The value must be a non-empty string if it is not `None`. Raises: `ValueError` - If the value is an empty string.

### _setCbackCommand(self, value) | source code
Property target used to set the cback command. The value must be a non-empty string if it is not `None`. Raises: `ValueError` - If the value is an empty string.

### _setOverrides(self, value) | source code
Property target used to set the command path overrides list. Either the value must be `None` or each element must be a `CommandOverride`. Raises: `ValueError` - If the value is not a `CommandOverride`

### _setHooks(self, value) | source code
Property target used to set the pre- and post-action hooks list. Either the value must be `None` or each element must be an `ActionHook`. Raises: `ValueError` - If the value is not a `CommandOverride`

### _setManagedActions(self, value) | source code
Property target used to set the managed actions list. Elements do not have to exist on disk at the time of assignment.

Property Details | [hide private]

### startingDay Day that starts the week. Get Method: _getStartingDay(self) - Property target used to get the starting day. Set Method: _setStartingDay(self, value) - Property target used to set the starting day.

### workingDir Working (temporary) directory to use for backups. Get Method: _getWorkingDir(self) - Property target used to get the working directory. Set Method: _setWorkingDir(self, value) - Property target used to set the working directory.

### backupUser Effective user that backups should run as. Get Method: _getBackupUser(self) - Property target used to get the backup user. Set Method: _setBackupUser(self, value) - Property target used to set the backup user.

### backupGroup Effective group that backups should run as. Get Method: _getBackupGroup(self) - Property target used to get the backup group. Set Method: _setBackupGroup(self, value) - Property target used to set the backup group.

### rcpCommand Default rcp-compatible copy command for staging. Get Method: _getRcpCommand(self) - Property target used to get the rcp command. Set Method: _setRcpCommand(self, value) - Property target used to set the rcp command.

### rshCommand Default rsh-compatible command to use for remote shells. Get Method: _getRshCommand(self) - Property target used to get the rsh command. Set Method: _setRshCommand(self, value) - Property target used to set the rsh command.

### overrides List of configured command path overrides, if any. Get Method: _getOverrides(self) - Property target used to get the command path overrides list. Set Method: _setOverrides(self, value) - Property target used to set the command path overrides list.

### cbackCommand Default cback-compatible command to use on managed remote peers. Get Method: _getCbackCommand(self) - Property target used to get the cback command. Set Method: _setCbackCommand(self, value) - Property target used to set the cback command.

### hooks List of configured pre- and post-action hooks. Get Method: _getHooks(self) - Property target used to get the command path hooks list. Set Method: _setHooks(self, value) - Property target used to set the pre- and post-action hooks list.

### managedActions Default set of actions that are managed on remote peers. Get Method: _getManagedActions(self) - Property target used to get the managed actions list. Set Method: _setManagedActions(self, value) - Property target used to set the managed actions list.