mirror of
https://github.com/containers/podman-compose.git
synced 2025-04-11 11:08:47 +02:00
Merge pull request #1117 from rjeffman/no_exception_if_service_is_not_in_compose
Don't raise exception on inexistent services in 'down' command
This commit is contained in:
commit
04fcc26a79
1
newsfragments/compose_down_inexistent_service.bugfix
Normal file
1
newsfragments/compose_down_inexistent_service.bugfix
Normal file
@ -0,0 +1 @@
|
||||
- Fixed KeyError in case podman-compose down was called with an inexistent service
|
@ -2648,7 +2648,8 @@ def get_excluded(compose, args):
|
||||
if args.services:
|
||||
excluded = set(compose.services)
|
||||
for service in args.services:
|
||||
if not args.no_deps:
|
||||
# we need 'getattr' as compose_down_parse dose not configure 'no_deps'
|
||||
if service in compose.services and not getattr(args, "no_deps", False):
|
||||
excluded -= set(x.name for x in compose.services[service]["_deps"])
|
||||
excluded.discard(service)
|
||||
log.debug("** excluding: %s", excluded)
|
||||
|
Loading…
Reference in New Issue
Block a user