mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-24 13:04:00 -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
|
|
@ -138,7 +138,7 @@ class InventoryModule(BaseInventoryPlugin):
|
|||
try:
|
||||
response = open_url(url, headers=self.headers)
|
||||
except Exception as e:
|
||||
self.display.warning("An error happened while fetching: %s" % url)
|
||||
self.display.warning(f"An error happened while fetching: {url}")
|
||||
return None
|
||||
|
||||
try:
|
||||
|
|
@ -245,8 +245,8 @@ class InventoryModule(BaseInventoryPlugin):
|
|||
}
|
||||
|
||||
self.headers = {
|
||||
'Authorization': "Bearer %s" % token,
|
||||
'User-Agent': "ansible %s Python %s" % (ansible_version, python_version.split(' ', 1)[0]),
|
||||
'Authorization': f"Bearer {token}",
|
||||
'User-Agent': f"ansible {ansible_version} Python {python_version.split(' ', 1)[0]}",
|
||||
'Content-type': 'application/json'
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue