inventory plugins: use f-strings (#9323)

* inventory plugins: use f-strings

* add changelog frag
This commit is contained in:
Alexei Znamensky 2024-12-23 23:02:30 +13:00 committed by GitHub
parent cb2cd00cd1
commit 1d8f0b2942
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 148 additions and 149 deletions

View file

@ -203,7 +203,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
else:
# found vars, accumulate in hostvars for clean inventory set
pref_k = make_unsafe('vbox_' + k.strip().replace(' ', '_'))
pref_k = make_unsafe(f"vbox_{k.strip().replace(' ', '_')}")
leading_spaces = len(k) - len(k.lstrip(' '))
if 0 < leading_spaces <= 2:
if prevkey not in hostvars[current_host] or not isinstance(hostvars[current_host][prevkey], dict):