Class Defaults
source code
Class used to manipulate ClusterShell defaults.
The following attributes may be read at any time and also changed
programmatically, for most of them **before** ClusterShell objects are
initialized (like Task):
* stderr (boolean; default is ``False``) * stdout_msgtree (boolean;
default is ``True``) * stderr_msgtree (boolean; default is ``True``) *
engine (string; default is ``'auto'``) * port_qlimit (integer; default is
``100``) * local_workername (string; default is ``'exec'``) *
distant_workername (string; default is ``'ssh'``) * debug (boolean;
default is ``False``) * print_debug (function; default is internal) *
fanout (integer; default is ``64``) * grooming_delay (float; default is
``0.25``) * connect_timeout (float; default is ``10``) * command_timeout
(float; default is ``0``)
Example of use:
>>> from ClusterShell.Defaults import DEFAULTS
>>> from ClusterShell.Task import task_self
>>> # Change default distant worker to rsh (WorkerRsh)
... DEFAULTS.distant_workername = 'rsh'
>>> task = task_self()
>>> task.run("uname -r", nodes="cs[01-03]")
<ClusterShell.Worker.Rsh.WorkerRsh object at 0x1f4a410>
>>> list((str(msg), nodes) for msg, nodes in task.iter_buffers())
[('3.10.0-229.7.2.el7.x86_64', ['cs02', 'cs01', 'cs03'])]
The library default values of all of the above attributes may be
changed using the defaults.conf configuration file, except for
*print_debug* (cf. :ref:`defaults-config`). An example defaults.conf file
should be included with ClusterShell. Remember that this could affect all
applications using ClusterShell.
|
|
|
|
|
|
|
|
__getattr__(self,
name)
Defaults attribute lookup |
source code
|
|
|
|
|
|
Inherited from object:
__delattr__,
__format__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__repr__,
__sizeof__,
__str__,
__subclasshook__
|
|
Inherited from object:
__class__
|
|
Initialize Defaults from config filenames
- Overrides:
object.__init__
|
|
Defaults attribute assignment
- Overrides:
object.__setattr__
|
_TASK_DEFAULT
- Value:
{'auto_tree': True,
'distant_workername': 'ssh',
'engine': 'auto',
'local_workername': 'exec',
'port_qlimit': 100,
'stderr': False,
'stderr_msgtree': True,
'stdout_msgtree': True}
|
|
_TASK_DEFAULT_CONVERTERS
- Value:
{'auto_tree': <unbound method ConfigParser.getboolean>,
'distant_workername': <unbound method ConfigParser.get>,
'engine': <unbound method ConfigParser.get>,
'local_workername': <unbound method ConfigParser.get>,
'port_qlimit': <unbound method ConfigParser.getint>,
'stderr': <unbound method ConfigParser.getboolean>,
'stderr_msgtree': <unbound method ConfigParser.getboolean>,
'stdout_msgtree': <unbound method ConfigParser.getboolean>}
|
|
_TASK_INFO
- Value:
{'command_timeout': 0,
'connect_timeout': 10,
'debug': False,
'fanout': 64,
'grooming_delay': 0.25,
'print_debug': <function _task_print_debug at 0x1e1e050>}
|
|
_TASK_INFO_CONVERTERS
- Value:
{'command_timeout': <unbound method ConfigParser.getfloat>,
'connect_timeout': <unbound method ConfigParser.getfloat>,
'debug': <unbound method ConfigParser.getboolean>,
'fanout': <unbound method ConfigParser.getint>,
'grooming_delay': <unbound method ConfigParser.getfloat>}
|
|