Skip to content

Commit

Permalink
fix method
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamack committed Feb 10, 2025
1 parent 4424e9f commit bea6ab6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions awx/api/views/analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ def _forward_response(self, response):

return Response(response.content, status=response.status_code)

def base_auth_request(request: requests.Request, method: str, url: str, user: str, pw: str, headers: dict[str, str]) -> requests.Response:
@staticmethod
def _base_auth_request(request: requests.Request, method: str, url: str, user: str, pw: str, headers: dict[str, str]) -> requests.Response:
response = requests.request(
method,
url,
Expand Down Expand Up @@ -217,11 +218,11 @@ def _send_to_analytics(self, request, method):
)
except requests.RequestException:
logger.error("Automation Analytics API request failed, trying base auth method")
response = base_auth_request(request, method, url, rh_user, rh_password, headers)
response = self._base_auth_request(request, method, url, rh_user, rh_password, headers)
except MissingSettings:
rh_user = self._get_setting('SUBSCRIPTIONS_USERNAME', None, ERROR_MISSING_USER)
rh_password = self._get_setting('SUBSCRIPTIONS_PASSWORD', None, ERROR_MISSING_PASSWORD)
response = base_auth_request(request, method, url, rh_user, rh_password, headers)
response = self._base_auth_request(request, method, url, rh_user, rh_password, headers)
#
# Missing or wrong user/pass
#
Expand Down

0 comments on commit bea6ab6

Please sign in to comment.