diff options
author | Steve Baker <sbaker@redhat.com> | 2017-03-09 02:19:59 +0000 |
---|---|---|
committer | Steve Baker <sbaker@redhat.com> | 2017-03-09 02:22:10 +0000 |
commit | af03e4d34bffcabd26e72eb85137b91f348ee2cb (patch) | |
tree | 6562664e21482be421980bbf585ce0ae65ba2564 /docker | |
parent | a1b3e2ee756b2957118c65cab83814461cce1b07 (diff) |
docker-puppet.py fail if any worker fails
Currently returncodes are ignored from docker puppet workers, so a
failed puppet apply may not manifest until later in the stack
deployment due to some other failure.
This change logs any failures at the end of the run and returns a
failure code if any worker returns a failure code.
Change-Id: I6a504dbeb4c0ac465ce10e7647830524fe0a1160
Diffstat (limited to 'docker')
-rwxr-xr-x | docker/docker-puppet.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/docker/docker-puppet.py b/docker/docker-puppet.py index 157bf63f..f5d814c1 100755 --- a/docker/docker-puppet.py +++ b/docker/docker-puppet.py @@ -253,4 +253,13 @@ for p in process_map: # Fire off processes to perform each configuration. Defaults # to the number of CPUs on the system. p = multiprocessing.Pool(process_count) -p.map(mp_puppet_config, process_map) +returncodes = list(p.map(mp_puppet_config, process_map)) +config_volumes = [pm[0] for pm in process_map] +success = True +for returncode, config_volume in zip(returncodes, config_volumes): + if returncode != 0: + print('ERROR configuring %s' % config_volume) + success = False + +if not success: + sys.exit(1) |