summaryrefslogtreecommitdiffstats
path: root/plugins/plugin_examples
diff options
context:
space:
mode:
authorJoel Andres Granados <jgranado@redhat.com>2008-02-25 15:05:32 +0100
committerJoel Andres Granados <jgranado@redhat.com>2008-02-26 14:43:55 +0100
commitd811af9085d1c7a1262141d232666354bb2379b1 (patch)
treec8265e73742e40d923383413c36b2b58a13a42c3 /plugins/plugin_examples
parent6cc51ff0f5c4dda26fc196d0e8db35c525b79844 (diff)
downloadfirstaidkit-d811af9085d1c7a1262141d232666354bb2379b1.tar.gz
firstaidkit-d811af9085d1c7a1262141d232666354bb2379b1.tar.xz
firstaidkit-d811af9085d1c7a1262141d232666354bb2379b1.zip
Use a more intuitive return class names for the default flows.
True and false are not very generic for the flows. Favorable and Unfavorable are not completely generic but are better.
Diffstat (limited to 'plugins/plugin_examples')
-rw-r--r--plugins/plugin_examples/dep1.py12
-rw-r--r--plugins/plugin_examples/dep2.py12
-rw-r--r--plugins/plugin_examples/dep3.py12
-rw-r--r--plugins/plugin_examples/sample1Plugin.py12
-rw-r--r--plugins/plugin_examples/sample2Plugin.py28
-rw-r--r--plugins/plugin_examples/sample3Plugin/sample3Plugin.py24
6 files changed, 50 insertions, 50 deletions
diff --git a/plugins/plugin_examples/dep1.py b/plugins/plugin_examples/dep1.py
index 5c42462..533977d 100644
--- a/plugins/plugin_examples/dep1.py
+++ b/plugins/plugin_examples/dep1.py
@@ -31,23 +31,23 @@ class Sample1Plugin(Plugin):
return set(["sample_dependency"]).union(Plugin.getDeps())
def prepare(self):
- self._result=ReturnValueTrue
+ self._result=Favorable
def backup(self):
- self._result=ReturnValueTrue
+ self._result=Favorable
def restore(self):
- self._result=ReturnValueTrue
+ self._result=Favorable
def diagnose(self):
- self._result=ReturnValueTrue
+ self._result=Favorable
self.provide("sample_dependency2")
def fix(self):
- self._result=ReturnValueFalse
+ self._result=Unfavorable
def clean(self):
- self._result=ReturnValueTrue
+ self._result=Favorable
def get_plugin():
return Sample1Plugin
diff --git a/plugins/plugin_examples/dep2.py b/plugins/plugin_examples/dep2.py
index 79394ac..8339be8 100644
--- a/plugins/plugin_examples/dep2.py
+++ b/plugins/plugin_examples/dep2.py
@@ -31,22 +31,22 @@ class Sample1Plugin(Plugin):
return set(["sample_dependency", "sample_dependency2"]).union(Plugin.getDeps())
def prepare(self):
- self._result=ReturnValueTrue
+ self._result=Favorable
def backup(self):
- self._result=ReturnValueTrue
+ self._result=Favorable
def restore(self):
- self._result=ReturnValueTrue
+ self._result=Favorable
def diagnose(self):
- self._result=ReturnValueTrue
+ self._result=Favorable
def fix(self):
- self._result=ReturnValueFalse
+ self._result=Unfavorable
def clean(self):
- self._result=ReturnValueTrue
+ self._result=Favorable
def get_plugin():
return Sample1Plugin
diff --git a/plugins/plugin_examples/dep3.py b/plugins/plugin_examples/dep3.py
index 53c5dd7..53bcac9 100644
--- a/plugins/plugin_examples/dep3.py
+++ b/plugins/plugin_examples/dep3.py
@@ -27,23 +27,23 @@ class Sample1Plugin(Plugin):
Plugin.__init__(self, *args, **kwargs)
def prepare(self):
- self._result=ReturnValueTrue
+ self._result=Favorable
def backup(self):
- self._result=ReturnValueTrue
+ self._result=Favorable
def restore(self):
- self._result=ReturnValueTrue
+ self._result=Favorable
def diagnose(self):
- self._result=ReturnValueTrue
+ self._result=Favorable
self.provide("sample_dependency")
def fix(self):
- self._result=ReturnValueFalse
+ self._result=Unfavorable
def clean(self):
- self._result=ReturnValueTrue
+ self._result=Favorable
def get_plugin():
return Sample1Plugin
diff --git a/plugins/plugin_examples/sample1Plugin.py b/plugins/plugin_examples/sample1Plugin.py
index a3aaa7e..3c5693d 100644
--- a/plugins/plugin_examples/sample1Plugin.py
+++ b/plugins/plugin_examples/sample1Plugin.py
@@ -28,27 +28,27 @@ class Sample1Plugin(Plugin):
self.reporting = kwargs.get('reporting')
def prepare(self):
- self._result=ReturnValueTrue
+ self._result=Favorable
self.reporting.info("Sample1Plugin in Prepare task", self)
def backup(self):
- self._result=ReturnValueTrue
+ self._result=Favorable
self.reporting.info("Sample1Plugin in backup task", self)
def restore(self):
- self._result=ReturnValueTrue
+ self._result=Favorable
self.reporting.info("Sample1Plugin in Restore task", self)
def diagnose(self):
- self._result=ReturnValueTrue
+ self._result=Favorable
self.reporting.info("Sample1Plugin in diagnose task", self)
def fix(self):
- self._result=ReturnValueFalse
+ self._result=Unfavorable
self.reporting.info("Sample1Plugin in Fix task", self)
def clean(self):
- self._result=ReturnValueTrue
+ self._result=Favorable
self.reporting.info("Sample1Plugin in Clean task", self)
def get_plugin():
diff --git a/plugins/plugin_examples/sample2Plugin.py b/plugins/plugin_examples/sample2Plugin.py
index bcaf4de..e3eaea5 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" : {ReturnValueTrue: "diagnose"},
- "diagnose" : {ReturnValueTrue: "clean", ReturnValueFalse: "backup"},
- "backup" : {ReturnValueTrue: "fix", ReturnValueFalse: "clean"},
- "restore" : {ReturnValueTrue: "clean", ReturnValueFalse: "clean"},
- "fix" : {ReturnValueTrue: "extraStep", ReturnValueFalse: "restore"},
- "extraStep" : {ReturnValueTrue: "clean", ReturnValueFalse: "clean"},
- "clean" : {ReturnValueTrue: Plugin.final}
+ "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}
}, 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=ReturnValueTrue
+ self._result=Favorable
def clean(self):
- self._result=ReturnValueTrue
+ self._result=Favorable
def backup(self):
- self._result=ReturnValueTrue
+ self._result=Favorable
def restore(self):
- self._result=ReturnValueTrue
+ self._result=Favorable
def diagnose(self):
- self._result=ReturnValueFalse
+ self._result=Unfavorable
def fix(self):
- self._result=ReturnValueTrue
+ self._result=Favorable
def extraStep(self):
- self._result=ReturnValueTrue
+ self._result=Favorable
def get_plugin():
return Sample2Plugin
diff --git a/plugins/plugin_examples/sample3Plugin/sample3Plugin.py b/plugins/plugin_examples/sample3Plugin/sample3Plugin.py
index 6ec95ec..b4a8138 100644
--- a/plugins/plugin_examples/sample3Plugin/sample3Plugin.py
+++ b/plugins/plugin_examples/sample3Plugin/sample3Plugin.py
@@ -36,9 +36,9 @@ class Sample3Plugin(Plugin):
(out, err) = proc.communicate()
out = out.strip()
if out[-5:] == "false":
- self._result=ReturnValueFalse
+ self._result=Unfavorable
elif out[-4:] == "true":
- self._result=ReturnValueTrue
+ self._result=Favorable
def clean(self):
clean = [Config.plugin.path+"/sample3Plugin/plugin", "--task", "clean"]
@@ -46,9 +46,9 @@ class Sample3Plugin(Plugin):
(out, err) = proc.communicate()
out = out.strip()
if out[-5:] == "false":
- self._result=ReturnValueFalse
+ self._result=Unfavorable
elif out[-4:] == "true":
- self._result=ReturnValueTrue
+ self._result=Favorable
def backup(self):
backup = [Config.plugin.path+"/sample3Plugin/plugin", "--task", "backup"]
@@ -56,9 +56,9 @@ class Sample3Plugin(Plugin):
(out, err) = proc.communicate()
out = out.strip()
if out[-5:] == "false":
- self._result=ReturnValueFalse
+ self._result=Unfavorable
elif out[-4:] == "true":
- self._result=ReturnValueTrue
+ self._result=Favorable
def restore(self):
restore = [Config.plugin.path+"/sample3Plugin/plugin", "--task", "restore"]
@@ -66,9 +66,9 @@ class Sample3Plugin(Plugin):
(out, err) = proc.communicate()
out = out.strip()
if out[-5:] == "false":
- self._result=ReturnValueFalse
+ self._result=Unfavorable
elif out[-4:] == "true":
- self._result=ReturnValueTrue
+ self._result=Favorable
def diagnose(self):
diagnose = [Config.plugin.path+"/sample3Plugin/plugin", "--task", "diagnose"]
@@ -76,9 +76,9 @@ class Sample3Plugin(Plugin):
(out, err) = proc.communicate()
out = out.strip()
if out[-5:] == "false":
- self._result=ReturnValueFalse
+ self._result=Unfavorable
elif out[-4:] == "true":
- self._result=ReturnValueTrue
+ self._result=Favorable
def fix(self):
fix = [Config.plugin.path+"/sample3Plugin/plugin", "--task", "fix"]
@@ -86,6 +86,6 @@ class Sample3Plugin(Plugin):
(out, err) = proc.communicate()
out = out.strip()
if out[-5:] == "false":
- self._result=ReturnValueFalse
+ self._result=Unfavorable
elif out[-4:] == "true":
- self._result=ReturnValueTrue
+ self._result=Favorable