|
Revision 27, 386 bytes
(checked in by daedalus, 4 years ago)
|
|
* Added 'authoritarian' mode, which allows you permit/deny each and every command
that will be issued to a remote device. Designed for testing new change scripts.
* Added a 'command_timeout' parameter to Command Provisioners, so you can override
the default command timeout of 300 seconds by setting an attribute in the config
file
* Added proper handling of the 'onfail: continue' idea. You can now specify that
if a change fails, and it is a pre-requisite for some other change, processing
will continue despite the failure.
* Added the onfail: retry feature. If a change fails, you can specify that it should
be retried. You can also set a max number of retries. The default is 3.
|
| Line | |
|---|
| 1 | # |
|---|
| 2 | # Utility functions |
|---|
| 3 | # |
|---|
| 4 | import logging |
|---|
| 5 | log = logging.getLogger('modipy') |
|---|
| 6 | |
|---|
| 7 | def substituteVariables(str, namespace={}): |
|---|
| 8 | """ |
|---|
| 9 | Perform variable substitution, given a string and a namespace. |
|---|
| 10 | """ |
|---|
| 11 | try: |
|---|
| 12 | str = str % namespace |
|---|
| 13 | return str |
|---|
| 14 | except KeyError, e: |
|---|
| 15 | log.error("Cannot perform substitution on string. KeyError on: %s, %s", str, e) |
|---|
| 16 | raise |
|---|
| 17 | |
|---|