mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 15:11:23 -07:00
replace concatenations with f-string in plugins (#10285)
Some checks are pending
EOL CI / EOL Sanity (Ⓐ2.16) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.16+py2.7) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.16+py3.11) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.16+py3.6) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/3/) (push) Waiting to run
nox / Run extra sanity tests (push) Waiting to run
Some checks are pending
EOL CI / EOL Sanity (Ⓐ2.16) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.16+py2.7) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.16+py3.11) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.16+py3.6) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/3/) (push) Waiting to run
nox / Run extra sanity tests (push) Waiting to run
* replace concatenations with f-string in plugins * add changelog frag
This commit is contained in:
parent
d4f2b2fb55
commit
3ab7a898c6
7 changed files with 20 additions and 14 deletions
|
@ -350,7 +350,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
|||
for hostname, host_vars in results['_meta']['hostvars'].items():
|
||||
iocage_hooks = []
|
||||
for hook in hooks_results:
|
||||
path = "/" + iocage_pool + "/iocage/jails/" + hostname + "/root" + hook
|
||||
path = f"/{iocage_pool}/iocage/jails/{hostname}/root{hook}"
|
||||
cmd_cat_hook = cmd.copy()
|
||||
cmd_cat_hook.append('cat')
|
||||
cmd_cat_hook.append(path)
|
||||
|
|
|
@ -224,7 +224,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
|||
vm_name_list.append(vm['name_label'])
|
||||
else:
|
||||
vm_duplicate_count = vm_name_list.count(vm['name_label'])
|
||||
entry_name = vm['name_label'] + "_" + str(vm_duplicate_count)
|
||||
entry_name = f"{vm['name_label']}_{vm_duplicate_count}"
|
||||
vm_name_list.append(vm['name_label'])
|
||||
else:
|
||||
entry_name = uuid
|
||||
|
@ -284,7 +284,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
|||
host_name_list.append(host['name_label'])
|
||||
else:
|
||||
host_duplicate_count = host_name_list.count(host['name_label'])
|
||||
entry_name = host['name_label'] + "_" + str(host_duplicate_count)
|
||||
entry_name = f"{host['name_label']}_{host_duplicate_count}"
|
||||
host_name_list.append(host['name_label'])
|
||||
else:
|
||||
entry_name = host['uuid']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue