1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-22 03:39:08 +00:00

replace literal HTTP codes with http.HTTPStatus (#11561)

* replace literal HTTP codes with http.HTTPStatus

* add changelog frag
This commit is contained in:
Alexei Znamensky 2026-03-11 10:03:55 +13:00 committed by GitHub
parent 1554f23bfb
commit 7436c0c9ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 135 additions and 78 deletions

View file

@ -6,6 +6,7 @@ from __future__ import annotations
import json
import typing as t
from http import HTTPStatus
from ansible.module_utils.basic import env_fallback
from ansible.module_utils.urls import basic_auth_header, fetch_url
@ -56,7 +57,7 @@ class BitbucketHelper:
headers=headers,
)
if info["status"] == 200:
if info["status"] == HTTPStatus.OK:
self.access_token = content["access_token"]
else:
self.module.fail_json(msg=f"Failed to retrieve access token: {info}")