From d11e04548e43c0ad099910cfacdb02d43e8a3a7c Mon Sep 17 00:00:00 2001 From: James Slagle Date: Tue, 1 Aug 2017 15:36:56 -0400 Subject: [PATCH] paunch apply should exit nonzero for failures Exit with the return code (nonzero) in case of a failure during paunch apply. When executing commands such as "docker run..." the actual docker return code will be used as the exit code, which is what we want so that the ansible tasks running paunch will actually fail. Change-Id: Ic656d27c4428249c5394dcd9f998c5bb4e264250 Partial-Bug: #1707997 --- paunch/cmd.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paunch/cmd.py b/paunch/cmd.py index e1a0972..d069230 100644 --- a/paunch/cmd.py +++ b/paunch/cmd.py @@ -68,13 +68,15 @@ class Apply(command.Command): with open(parsed_args.file, 'r') as f: config = yaml.safe_load(f) - paunch.apply( + stdout, stderr, rc = paunch.apply( parsed_args.config_id, config, managed_by='paunch', labels=labels ) + return rc + class Cleanup(command.Command):