Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit codes #521

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions podman_compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -1863,7 +1863,9 @@ def compose_push(compose, args):
continue
if services and cnt["_service"] not in services:
continue
compose.podman.run([], "push", [cnt["image"]], sleep=0)
exit_code = compose.podman.run([], "push", [cnt["image"]], sleep=0).wait()
if (not getattr(args, "ignore_push_failures", None)) and 0 != exit_code:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't we do args.ignore_push_failures? Seems simplier.

Also, please use exit_code != 0 style.

sys.exit(exit_code)


def build_one(compose, args, cnt):
Expand Down Expand Up @@ -1919,7 +1921,9 @@ def build_one(compose, args, cnt):
)
)
build_args.append(ctx)
compose.podman.run([], "build", build_args, sleep=0)
exit_code = compose.podman.run([], "build", build_args, sleep=0).wait()
if 0 != exit_code:
sys.exit(exit_code)


@cmd_run(podman_compose, "build", "build stack images")
Expand Down Expand Up @@ -2671,7 +2675,7 @@ def compose_push_parse(parser):
parser.add_argument(
"--ignore-push-failures",
action="store_true",
help="Push what it can and ignores images with push failures. (not implemented)",
help="Push what it can and ignores images with push failures.",
)
parser.add_argument(
"services", metavar="services", nargs="*", help="services to push"
Expand Down