Skip to content

Commit cc9faed

Browse files
committed
Don't raise exception on inexistent services in 'down' command
When running 'podman-compose down <service>', if service is not part of the compose, a KeyError exception was raised it function 'get_excluded'. By only allowing evaluation of services that exist in the compose provides a cleaner and gentler exit for this case. Signed-off-by: Rafael Guterres Jeffman <[email protected]>
1 parent d79ff01 commit cc9faed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

podman_compose.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2606,7 +2606,7 @@ def get_excluded(compose, args):
26062606
if args.services:
26072607
excluded = set(compose.services)
26082608
for service in args.services:
2609-
if not args.no_deps:
2609+
if service in compose.services and not getattr(args, "no_deps", False):
26102610
excluded -= set(x.name for x in compose.services[service]["_deps"])
26112611
excluded.discard(service)
26122612
log.debug("** excluding: %s", excluded)

0 commit comments

Comments
 (0)