Skip to content

Commit c3535dc

Browse files
committed
Reformat s2i command string for clarity
Use python3 f-strings so we can use the variable name directly at the substitution site and not have to keep count of the number of '%s' we've put in. Signed-off-by: Jonathan Dowland <jdowland@redhat.com>
1 parent 66f06d0 commit c3535dc

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

steps/s2i_steps.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,19 @@ def s2i_inner(context, application, path='.', env="", incremental=False, tag="ma
2929
mirror = "-e 'MAVEN_MIRROR_URL=%s'" % os.getenv("MAVEN_MIRROR_URL")
3030

3131
image_id = "integ-" + context.image
32-
command = "s2i build --loglevel=5 --pull-policy if-not-present %s --context-dir=%s -r=%s %s %s %s %s %s %s" % (
33-
mirror, path, tag, env, application, context.image, image_id, "--incremental" if incremental else "",
34-
"--runtime-image="+runtime_image if runtime_image else ""
35-
)
32+
33+
command = f"""s2i build --loglevel=5 --pull-policy if-not-present\
34+
{mirror}\
35+
--context-dir={path}\
36+
-r={tag}\
37+
{env}\
38+
{application}\
39+
{context.image}\
40+
{image_id}\
41+
{"--incremental" if incremental else ""}\
42+
{"--runtime-image="+runtime_image if runtime_image else ""}\
43+
"""
44+
3645
logger.info("Executing new S2I build with the command [%s]..." % command)
3746

3847
success, output = _execute(command)

0 commit comments

Comments
 (0)