Skip to content

Commit e2f474f

Browse files
committed
Use f-strings consistently in prepare-instances.py
1 parent f9c7f5b commit e2f474f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Diff for: prepare-instances.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,11 @@ def get_repo_url(instance):
143143
dockerfile.write(df_contents)
144144

145145
if instance.get('pg_version') is not None:
146-
build_args += ['--build-arg', ('PG_VERSION=' +
147-
instance.get('pg_version'))]
146+
build_args += ['--build-arg',
147+
(f'PG_VERSION={instance.get("pg_version")}')]
148148
if instance.get('pgpro_edition') is not None:
149-
build_args += ['--build-arg', ('PGPRO_EDN=' +
150-
instance.get('pgpro_edition'))]
149+
build_args += ['--build-arg',
150+
(f'PGPRO_EDN={instance.get("pgpro_edition")}')]
151151
pg_params = ''
152152
for param in instance.findall('config/pg_param'):
153153
pg_params += f"{param.get('name')} = '{param.get('value')}'\\n"
@@ -157,15 +157,15 @@ def get_repo_url(instance):
157157

158158
repo_url = get_repo_url(instance)
159159
if repo_url is not None:
160-
build_args += ['--build-arg', ('REPOSITORY=' + repo_url)]
160+
build_args += ['--build-arg', (f'REPOSITORY={repo_url}')]
161161

162162
extra = instance.find('extra')
163163
if extra is not None:
164164
if extra.find('source') is not None and \
165165
extra.find('source').get('type') == 'git':
166166
extra_git_url = extra.find('source').get('url')
167-
build_args += ['--build-arg', ('EXTRA_SRC_GIT=' +
168-
extra_git_url)]
167+
build_args += ['--build-arg',
168+
(f'EXTRA_SRC_GIT={extra_git_url}')]
169169
pg_modules = ''
170170
for pgm in extra.findall('pg_module'):
171171
pg_modules += (',' if pg_modules else '') + pgm.get('name')
@@ -182,8 +182,8 @@ def get_repo_url(instance):
182182
phase2_action = instance.find('os').get('phase2_action')
183183
if instance.find('os').get('extra_packages') is not None:
184184
extra_os_packages = instance.find('os').get('extra_packages')
185-
build_args += ['--build-arg', ('PHASE1_ACTION=' + phase1_action)]
186-
build_args += ['--build-arg', ('PHASE2_ACTION=' + phase2_action)]
185+
build_args += ['--build-arg', (f'PHASE1_ACTION={phase1_action}')]
186+
build_args += ['--build-arg', (f'PHASE2_ACTION={phase2_action}')]
187187
build_args += ['--build-arg',
188188
(f'EXTRA_OS_PACKAGES="{extra_os_packages}"')]
189189

0 commit comments

Comments
 (0)