diff options
author | Martin Sivak <msivak@redhat.com> | 2008-02-26 15:19:42 +0100 |
---|---|---|
committer | Martin Sivak <msivak@redhat.com> | 2008-02-26 15:19:42 +0100 |
commit | cd646619dd4723f8e4ac7325c3cc5e81193dbd40 (patch) | |
tree | 5575a412a13c8df27f93541d5933a174dfb19ba6 /plugins/plugin_examples/sample2Plugin.py | |
parent | cfe9ad54127a42b79f9057d341ec94099630b884 (diff) | |
download | firstaidkit-cd646619dd4723f8e4ac7325c3cc5e81193dbd40.tar.gz firstaidkit-cd646619dd4723f8e4ac7325c3cc5e81193dbd40.tar.xz firstaidkit-cd646619dd4723f8e4ac7325c3cc5e81193dbd40.zip |
Rename the Return* classes to more sane names and update everything to use them
Fix the NoOptionError exception throwing in configuration
Add the -a|--auto parameter to launch the automatic mode of operation
Diffstat (limited to 'plugins/plugin_examples/sample2Plugin.py')
-rw-r--r-- | plugins/plugin_examples/sample2Plugin.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/plugins/plugin_examples/sample2Plugin.py b/plugins/plugin_examples/sample2Plugin.py index 4b4764d..5b471e0 100644 --- a/plugins/plugin_examples/sample2Plugin.py +++ b/plugins/plugin_examples/sample2Plugin.py @@ -25,14 +25,14 @@ class Sample2Plugin(Plugin): # flows = Flow.init(Plugin) flows["extra"] = Flow({ - Plugin.initial: {ReturnValue: "prepare"}, - "prepare" : {ReturnFavorable: "diagnose"}, - "diagnose" : {ReturnFavorable: "clean", ReturnUnfavorable: "backup"}, - "backup" : {ReturnFavorable: "fix", ReturnUnfavorable: "clean"}, - "restore" : {ReturnFavorable: "clean", ReturnUnfavorable: "clean"}, - "fix" : {ReturnFavorable: "extraStep", ReturnUnfavorable: "restore"}, - "extraStep" : {ReturnFavorable: "clean", ReturnUnfavorable: "clean"}, - "clean" : {ReturnFavorable: Plugin.final} + Plugin.initial: {Return: "prepare"}, + "prepare" : {ReturnSuccess: "diagnose"}, + "diagnose" : {ReturnSuccess: "clean", ReturnFailure: "backup"}, + "backup" : {ReturnSuccess: "fix", ReturnFailure: "clean"}, + "restore" : {ReturnSuccess: "clean", ReturnFailure: "clean"}, + "fix" : {ReturnSuccess: "extraStep", ReturnFailure: "restore"}, + "extraStep" : {ReturnSuccess: "clean", ReturnFailure: "clean"}, + "clean" : {ReturnSuccess: Plugin.final} }, description="Fixing sequence with one added extraStep") default_flow = "extra" @@ -44,25 +44,25 @@ class Sample2Plugin(Plugin): Plugin.__init__(self, *args, **kwargs) def prepare(self): - self._result=ReturnFavorable + self._result=ReturnSuccess def clean(self): - self._result=ReturnFavorable + self._result=ReturnSuccess def backup(self): - self._result=ReturnFavorable + self._result=ReturnSuccess def restore(self): - self._result=ReturnFavorable + self._result=ReturnSuccess def diagnose(self): - self._result=ReturnUnfavorable + self._result=ReturnFailure def fix(self): - self._result=ReturnFavorable + self._result=ReturnSuccess def extraStep(self): - self._result=ReturnFavorable + self._result=ReturnSuccess def get_plugin(): return Sample2Plugin |