Skip to content

Commit

Permalink
black lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamack committed Feb 10, 2025
1 parent 322abf6 commit 4424e9f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions awx/api/views/analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ 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:
response = requests.request(

Check warning on line 185 in awx/api/views/analytics.py

View check run for this annotation

Codecov / codecov/patch

awx/api/views/analytics.py#L185

Added line #L185 was not covered by tests
method,
Expand All @@ -195,7 +194,6 @@ def base_auth_request(request: requests.Request, method: str, url: str, user: st
)
return response

Check warning on line 195 in awx/api/views/analytics.py

View check run for this annotation

Codecov / codecov/patch

awx/api/views/analytics.py#L195

Added line #L195 was not covered by tests


def _send_to_analytics(self, request, method):
try:
headers = self._request_headers(request)
Expand All @@ -215,7 +213,7 @@ def _send_to_analytics(self, request, method):
verify=settings.INSIGHTS_CERT_PATH,
params=getattr(request, 'query_params', {}),
json=getattr(request, 'data', {}),
timeout=(31, 31)
timeout=(31, 31),
)
except requests.RequestException:
logger.error("Automation Analytics API request failed, trying base auth method")
Expand Down
2 changes: 1 addition & 1 deletion awx/main/analytics/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def ship(path):
return False

Check warning on line 395 in awx/main/analytics/core.py

View check run for this annotation

Codecov / codecov/patch

awx/main/analytics/core.py#L394-L395

Added lines #L394 - L395 were not covered by tests
if not rh_password:
logger.error('REDHAT_PASSWORD and SUBSCRIPTIONS_USERNAME are not set')
return False
return False

Check warning on line 398 in awx/main/analytics/core.py

View check run for this annotation

Codecov / codecov/patch

awx/main/analytics/core.py#L397-L398

Added lines #L397 - L398 were not covered by tests
# Accept 2XX status_codes
if response.status_code >= 300:
logger.error('Upload failed with status {}, {}'.format(response.status_code, response.text))
Expand Down

0 comments on commit 4424e9f

Please sign in to comment.