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
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

@ -124,7 +124,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable):
# Create groups based on variable values and add the corresponding hosts to it
self._add_host_to_keyed_groups(self.get_option('keyed_groups'), host_attrs, host, strict=strict)
except Exception as e:
raise AnsibleParserError('Unable to fetch hosts from GitLab API, this was the original exception: %s' % to_native(e))
raise AnsibleParserError(f'Unable to fetch hosts from GitLab API, this was the original exception: {to_native(e)}')
def verify_file(self, path):
"""Return the possibly of a file being consumable by this plugin."""