commit: d8fd5aa979d2629173afed65dc4b406f9491fa5a Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> AuthorDate: Wed Sep 9 17:33:48 2015 +0000 Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org> CommitDate: Wed Sep 9 17:34:13 2015 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=d8fd5aa9
snapshot.py: Update the run() to return True/False same as stagebase Fixes Rick's issue with generating a snapshot exiting with 2. catalyst/targets/snapshot.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/catalyst/targets/snapshot.py b/catalyst/targets/snapshot.py index 1edcd02..87340b7 100644 --- a/catalyst/targets/snapshot.py +++ b/catalyst/targets/snapshot.py @@ -42,11 +42,12 @@ class snapshot(TargetBase, GenBase): def run(self): if "purgeonly" in self.settings["options"]: self.purge() - return + return True if "purge" in self.settings["options"]: self.purge() + success = True self.setup() print "Creating Portage tree snapshot "+self.settings["version_stamp"]+\ " from "+self.settings["portdir"]+"..." @@ -72,6 +73,7 @@ class snapshot(TargetBase, GenBase): auto_extension=True ) if not compressor.compress(infodict): + success = False print "Snapshot compression failure" else: filename = '.'.join([self.settings["snapshot_path"], @@ -81,7 +83,9 @@ class snapshot(TargetBase, GenBase): self.gen_digest_file(filename) self.cleanup() - print "snapshot: complete!" + if success: + print "snapshot: complete!" + return success def kill_chroot_pids(self): pass