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
# 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)