diff options
author | Joel Andres Granados <jgranado@redhat.com> | 2008-08-05 18:13:12 +0200 |
---|---|---|
committer | Joel Andres Granados <jgranado@redhat.com> | 2008-08-07 12:51:03 +0200 |
commit | 7f2d0899817cd7894b44ab014d1a0744691ac7d0 (patch) | |
tree | 6dc523653204ca5c93b93601764aa5872ca5168f /pyfirstaidkit | |
parent | 584cdf9d05c5f8ea4ec5a163b6a3e27dc9bcb704 (diff) | |
download | firstaidkit-7f2d0899817cd7894b44ab014d1a0744691ac7d0.tar.gz firstaidkit-7f2d0899817cd7894b44ab014d1a0744691ac7d0.tar.xz firstaidkit-7f2d0899817cd7894b44ab014d1a0744691ac7d0.zip |
Direct the failure in prepare to the clean step.
This is the better way of doing things. If the prepare step
is a failure we cannot ensure the sate that the plugin
expects. Its best to go to clean and exit with no changes.
Diffstat (limited to 'pyfirstaidkit')
-rw-r--r-- | pyfirstaidkit/plugins.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pyfirstaidkit/plugins.py b/pyfirstaidkit/plugins.py index 87d5994..82d7049 100644 --- a/pyfirstaidkit/plugins.py +++ b/pyfirstaidkit/plugins.py @@ -80,7 +80,8 @@ class Plugin(object): # flows["diagnose"] = Flow({ initial : {Return: "prepare"}, - "prepare" : {ReturnSuccess: "diagnose", None: "clean"}, + "prepare" : {ReturnSuccess: "diagnose", ReturnFailure: "clean", + None: "clean"}, "diagnose" : {ReturnSuccess: "clean", ReturnFailure: "clean", None: "clean"}, "clean" : {ReturnSuccess: final, ReturnFailure: final, None: final} @@ -88,7 +89,8 @@ class Plugin(object): flows["fix"] = Flow({ initial : {Return: "prepare"}, - "prepare" : {ReturnSuccess: "diagnose", None: "clean"}, + "prepare" : {ReturnSuccess: "diagnose", ReturnFailure: "clean", + None: "clean"}, "diagnose" : {ReturnSuccess: "clean", ReturnFailure: "backup", None: "clean"}, "backup" : {ReturnSuccess: "fix", ReturnFailure: "clean", |