mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-20 20:00:23 -07:00
[PR #9323/1d8f0b29 backport][stable-10] inventory plugins: use f-strings (#9332)
inventory plugins: use f-strings (#9323)
* inventory plugins: use f-strings
* add changelog frag
(cherry picked from commit 1d8f0b2942
)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
3fe559b88f
commit
2499c1132d
14 changed files with 148 additions and 149 deletions
|
@ -140,7 +140,7 @@ def _fetch_information(token, url):
|
|||
headers={'X-Auth-Token': token,
|
||||
'Content-type': 'application/json'})
|
||||
except Exception as e:
|
||||
raise AnsibleError("Error while fetching %s: %s" % (url, to_native(e)))
|
||||
raise AnsibleError(f"Error while fetching {url}: {to_native(e)}")
|
||||
try:
|
||||
raw_json = json.loads(to_text(response.read()))
|
||||
except ValueError:
|
||||
|
@ -161,7 +161,7 @@ def _fetch_information(token, url):
|
|||
|
||||
|
||||
def _build_server_url(api_endpoint):
|
||||
return "/".join([api_endpoint, "servers"])
|
||||
return f"{api_endpoint}/servers"
|
||||
|
||||
|
||||
def extract_public_ipv4(server_info):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue