Skip to content

Commit

Permalink
Passing return code from containers
Browse files Browse the repository at this point in the history
  • Loading branch information
jreichman committed Aug 24, 2023
1 parent e001984 commit a035caf
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/dfbar/dfbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ def process_docker_spec(spec, dockerfile=None, verbose=False,

logger.log_verbose('Run call args: %s' % call_args)

subprocess.check_call(call_args, shell=shell)
return subprocess.call(call_args, shell=shell)

return 0

def main():
# Process the command line arguments
Expand Down Expand Up @@ -289,23 +291,27 @@ def main():
logger.log_verbose('')

# Process the specs
ret = 0
try:
for spec in spec_list:
process_docker_spec(spec, dockerfile=dockerfile,
ret = process_docker_spec(spec, dockerfile=dockerfile,
verbose=verbose, run=run, allow_shell=allow_shell,
ignore_missing=ignore_missing, mode=mode,
custom_opts=custom_opts)

if ret != 0:
break
except Exception as e:
raise Exception('Processing failed with error: %s' % str(e))

return ret

def cli_entrypoint():
try:
main()
sys.exit(main())
except Exception as e:
print(e)
sys.exit(1)

sys.exit(0)

if __name__ == '__main__':
cli_entrypoint()

0 comments on commit a035caf

Please sign in to comment.