mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-02-04 07:51:50 +00:00
modules g*: use f-strings (#10958)
* modules g*: use f-strings * add changelog frag * remove extraneous to_native()
This commit is contained in:
parent
a3987c9844
commit
b67e7c83cf
31 changed files with 250 additions and 245 deletions
|
|
@ -99,13 +99,13 @@ def main():
|
|||
'Accept': 'application/vnd.github.v3+json',
|
||||
}
|
||||
|
||||
url = "https://api.github.com/repos/%s/%s/issues/%s" % (organization, repo, issue)
|
||||
url = f"https://api.github.com/repos/{organization}/{repo}/issues/{issue}"
|
||||
|
||||
response, info = fetch_url(module, url, headers=headers)
|
||||
if not (200 <= info['status'] < 400):
|
||||
if info['status'] == 404:
|
||||
module.fail_json(msg="Failed to find issue %s" % issue)
|
||||
module.fail_json(msg="Failed to send request to %s: %s" % (url, info['msg']))
|
||||
module.fail_json(msg=f"Failed to find issue {issue}")
|
||||
module.fail_json(msg=f"Failed to send request to {url}: {info['msg']}")
|
||||
|
||||
gh_obj = json.loads(response.read())
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue