@@ -3148,12 +3148,12 @@ class PullImage:
3148
3148
3149
3149
def __post_init__ (self ) -> None :
3150
3150
if self .policy not in self .POLICY_PRIORITY :
3151
- log .debug (f "Pull policy { self . policy } is not valid, using 'missing' instead" )
3151
+ log .debug ("Pull policy %s is not valid, using 'missing' instead" , self . policy )
3152
3152
self .policy = "missing"
3153
3153
3154
3154
def update_policy (self , new_policy : str ) -> None :
3155
3155
if new_policy not in self .POLICY_PRIORITY :
3156
- log .debug (f "Pull policy { new_policy } is not valid, ignoring it" )
3156
+ log .debug ("Pull policy %s is not valid, ignoring it" , new_policy )
3157
3157
return
3158
3158
3159
3159
if self .POLICY_PRIORITY [new_policy ] > self .POLICY_PRIORITY [self .policy ]:
@@ -3215,17 +3215,16 @@ async def pull_images(
3215
3215
return 0
3216
3216
3217
3217
3218
- @cmd_run (podman_compose , "up" , "Create and start the entire stack or some of its services" )
3219
- async def compose_up (compose : PodmanCompose , args : argparse .Namespace ) -> int | None :
3220
- excluded = get_excluded (compose , args )
3221
-
3218
+ async def prepare_images (
3219
+ compose : PodmanCompose , args : argparse .Namespace , excluded : set [str ]
3220
+ ) -> int | None :
3222
3221
log .info ("pulling images: ..." )
3222
+
3223
3223
pull_services = [v for k , v in compose .services .items () if k not in excluded ]
3224
3224
err = await PullImage .pull_images (compose .podman , args , pull_services )
3225
3225
if err :
3226
3226
log .error ("Pull image failed" )
3227
- if not args .dry_run :
3228
- return err
3227
+ return err
3229
3228
3230
3229
log .info ("building images: ..." )
3231
3230
@@ -3235,8 +3234,20 @@ async def compose_up(compose: PodmanCompose, args: argparse.Namespace) -> int |
3235
3234
build_exit_code = await compose .commands ["build" ](compose , build_args )
3236
3235
if build_exit_code != 0 :
3237
3236
log .error ("Build command failed" )
3238
- if not args .dry_run :
3239
- return build_exit_code
3237
+ return build_exit_code
3238
+
3239
+ return 0
3240
+
3241
+
3242
+ @cmd_run (podman_compose , "up" , "Create and start the entire stack or some of its services" )
3243
+ async def compose_up (compose : PodmanCompose , args : argparse .Namespace ) -> int | None :
3244
+ excluded = get_excluded (compose , args )
3245
+
3246
+ exit_code = await prepare_images (compose , args , excluded )
3247
+ if exit_code != 0 :
3248
+ log .error ("Prepare images failed" )
3249
+ if not args .dry_run :
3250
+ return exit_code
3240
3251
3241
3252
# if needed, tear down existing containers
3242
3253
0 commit comments