modules def*: use f-strings (#10947)

* modules def*: use f-strings

* remove !s from f-strings

* add changelog frag
This commit is contained in:
Alexei Znamensky
2025-10-24 09:12:10 +13:00
committed by GitHub
parent 258e65f5fc
commit a3987c9844
23 changed files with 178 additions and 174 deletions

View File

@@ -115,7 +115,7 @@ def _get_easy_install(module, env=None, executable=None):
opt_dirs = []
else:
# Try easy_install with the virtualenv directory first.
opt_dirs = ['%s/bin' % env]
opt_dirs = [f'{env}/bin']
for basename in candidate_easy_inst_basenames:
easy_install = module.get_bin_path(basename, False, opt_dirs)
if easy_install is not None:
@@ -161,7 +161,7 @@ def main():
if not os.path.exists(os.path.join(env, 'bin', 'activate')):
if module.check_mode:
module.exit_json(changed=True)
command = '%s %s' % (virtualenv, env)
command = f'{virtualenv} {env}'
if site_packages:
command += ' --system-site-packages'
cwd = tempfile.gettempdir()