1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-03-31 01:16:17 +00:00

modules p*: use f-strings (#10974)

* modules p*: use f-strings

* add changelog frag
This commit is contained in:
Alexei Znamensky 2025-10-26 19:48:51 +13:00 committed by GitHub
parent d51e4c188b
commit 8120e9347e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
42 changed files with 299 additions and 300 deletions

View file

@ -174,10 +174,10 @@ def main():
for dep in module.params['dependencies']:
match = pkg_dep_re.match(dep)
if not match:
module.fail_json(msg="Failed to parse version requirement '{0}'. Must be formatted like 'ansible>2.6'".format(dep))
module.fail_json(msg=f"Failed to parse version requirement '{dep}'. Must be formatted like 'ansible>2.6'")
pkg, op, version = match.groups()
if op is not None and op not in operations:
module.fail_json(msg="Failed to parse version requirement '{0}'. Operator must be one of >, <, <=, >=, or ==".format(dep))
module.fail_json(msg=f"Failed to parse version requirement '{dep}'. Operator must be one of >, <, <=, >=, or ==")
try:
existing = pkg_resources.get_distribution(pkg).version
except pkg_resources.DistributionNotFound: