@@ -3279,17 +3279,16 @@ async def pull_images(
32793279 return 0
32803280
32813281
3282- @cmd_run (podman_compose , "up" , "Create and start the entire stack or some of its services" )
3283- async def compose_up (compose : PodmanCompose , args : argparse .Namespace ) -> int | None :
3284- excluded = get_excluded (compose , args )
3285-
3282+ async def prepare_images (
3283+ compose : PodmanCompose , args : argparse .Namespace , excluded : set [str ]
3284+ ) -> int | None :
32863285 log .info ("pulling images: ..." )
3286+
32873287 pull_services = [v for k , v in compose .services .items () if k not in excluded ]
32883288 err = await PullImage .pull_images (compose .podman , args , pull_services )
32893289 if err :
32903290 log .error ("Pull image failed" )
3291- if not args .dry_run :
3292- return err
3291+ return err
32933292
32943293 log .info ("building images: ..." )
32953294
@@ -3299,8 +3298,20 @@ async def compose_up(compose: PodmanCompose, args: argparse.Namespace) -> int |
32993298 build_exit_code = await compose .commands ["build" ](compose , build_args )
33003299 if build_exit_code != 0 :
33013300 log .error ("Build command failed" )
3302- if not args .dry_run :
3303- return build_exit_code
3301+ return build_exit_code
3302+
3303+ return 0
3304+
3305+
3306+ @cmd_run (podman_compose , "up" , "Create and start the entire stack or some of its services" )
3307+ async def compose_up (compose : PodmanCompose , args : argparse .Namespace ) -> int | None :
3308+ excluded = get_excluded (compose , args )
3309+
3310+ exit_code = await prepare_images (compose , args , excluded )
3311+ if exit_code != 0 :
3312+ log .error ("Prepare images failed" )
3313+ if not args .dry_run :
3314+ return exit_code
33043315
33053316 # if needed, tear down existing containers
33063317
0 commit comments