1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-02-04 07:51:50 +00:00

fix ruff case UP031 (#11223)

* fix ruff case UP031

* refactor backslashout of f-string for the sake of old Pythons

* add changelog frag

* Update plugins/modules/imc_rest.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* scaleway_user_data: fix bug and make it an f-string

* reformat

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Alexei Znamensky 2025-11-29 20:28:22 +13:00 committed by GitHub
parent 1ab9be152f
commit d550baacfa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 72 additions and 63 deletions

View file

@ -108,10 +108,10 @@ from ansible.module_utils.basic import AnsibleModule
def do_install(module, mode, rootfs, container, image, values_list, backend):
system_list = ["--system"] if mode == "system" else []
user_list = ["--user"] if mode == "user" else []
rootfs_list = ["--rootfs=%s" % rootfs] if rootfs else []
rootfs_list = [f"--rootfs={rootfs}"] if rootfs else []
atomic_bin = module.get_bin_path("atomic")
args = (
[atomic_bin, "install", "--storage=%s" % backend, "--name=%s" % container]
[atomic_bin, "install", f"--storage={backend}", f"--name={container}"]
+ system_list
+ user_list
+ rootfs_list
@ -128,7 +128,7 @@ def do_install(module, mode, rootfs, container, image, values_list, backend):
def do_update(module, container, image, values_list):
atomic_bin = module.get_bin_path("atomic")
args = [atomic_bin, "containers", "update", "--rebase=%s" % image] + values_list + [container]
args = [atomic_bin, "containers", "update", f"--rebase={image}"] + values_list + [container]
rc, out, err = module.run_command(args, check_rc=False)
if rc != 0:
module.fail_json(rc=rc, msg=err)
@ -139,7 +139,7 @@ def do_update(module, container, image, values_list):
def do_uninstall(module, name, backend):
atomic_bin = module.get_bin_path("atomic")
args = [atomic_bin, "uninstall", "--storage=%s" % backend, name]
args = [atomic_bin, "uninstall", f"--storage={backend}", name]
rc, out, err = module.run_command(args, check_rc=False)
if rc != 0:
module.fail_json(rc=rc, msg=err)
@ -169,7 +169,7 @@ def core(module):
atomic_bin = module.get_bin_path("atomic")
module.run_command_environ_update = dict(LANG="C", LC_ALL="C", LC_MESSAGES="C")
values_list = ["--set=%s" % x for x in values] if values else []
values_list = [f"--set={x}" for x in values] if values else []
args = [
atomic_bin,
@ -179,9 +179,9 @@ def core(module):
"-n",
"--all",
"-f",
"backend=%s" % backend,
f"backend={backend}",
"-f",
"container=%s" % name,
f"container={name}",
]
rc, out, err = module.run_command(args, check_rc=False)
if rc != 0: