summaryrefslogtreecommitdiffstats
path: root/plugins/plugin_examples/sample2Plugin.py
diff options
context:
space:
mode:
authorJoel Andres Granados <jgranado@redhat.com>2008-02-25 15:11:47 +0100
committerJoel Andres Granados <jgranado@redhat.com>2008-02-26 14:43:55 +0100
commitcfe9ad54127a42b79f9057d341ec94099630b884 (patch)
tree6901da68ca2008d47a4e8c13e713c1f5d2a0497a /plugins/plugin_examples/sample2Plugin.py
parentd811af9085d1c7a1262141d232666354bb2379b1 (diff)
downloadfirstaidkit-cfe9ad54127a42b79f9057d341ec94099630b884.tar.gz
firstaidkit-cfe9ad54127a42b79f9057d341ec94099630b884.tar.xz
firstaidkit-cfe9ad54127a42b79f9057d341ec94099630b884.zip
Appeninding Return to the class names help to identify them in the plugin code.
Diffstat (limited to 'plugins/plugin_examples/sample2Plugin.py')
-rw-r--r--plugins/plugin_examples/sample2Plugin.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/plugins/plugin_examples/sample2Plugin.py b/plugins/plugin_examples/sample2Plugin.py
index e3eaea5..4b4764d 100644
--- a/plugins/plugin_examples/sample2Plugin.py
+++ b/plugins/plugin_examples/sample2Plugin.py
@@ -26,13 +26,13 @@ class Sample2Plugin(Plugin):
flows = Flow.init(Plugin)
flows["extra"] = Flow({
Plugin.initial: {ReturnValue: "prepare"},
- "prepare" : {Favorable: "diagnose"},
- "diagnose" : {Favorable: "clean", Unfavorable: "backup"},
- "backup" : {Favorable: "fix", Unfavorable: "clean"},
- "restore" : {Favorable: "clean", Unfavorable: "clean"},
- "fix" : {Favorable: "extraStep", Unfavorable: "restore"},
- "extraStep" : {Favorable: "clean", Unfavorable: "clean"},
- "clean" : {Favorable: Plugin.final}
+ "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}
}, 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=Favorable
+ self._result=ReturnFavorable
def clean(self):
- self._result=Favorable
+ self._result=ReturnFavorable
def backup(self):
- self._result=Favorable
+ self._result=ReturnFavorable
def restore(self):
- self._result=Favorable
+ self._result=ReturnFavorable
def diagnose(self):
- self._result=Unfavorable
+ self._result=ReturnUnfavorable
def fix(self):
- self._result=Favorable
+ self._result=ReturnFavorable
def extraStep(self):
- self._result=Favorable
+ self._result=ReturnFavorable
def get_plugin():
return Sample2Plugin