Skip to content

Commit

Permalink
feat: Test GET from Inventory
Browse files Browse the repository at this point in the history
Inventory is tested along with Ingress and an API ping. Hosts are listed as the most basic Inventory GET request.
  • Loading branch information
Glutexo committed Dec 30, 2024
1 parent 6c86c6b commit 8d81053
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions insights/client/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def __init__(self, config):
self.inventory_url = self.api_url + "/inventory/v1"

if self.config.legacy_upload:
self.ping_url = self.base_url
self.ping_url = self.base_url + "/"
else:
self.ping_url = self.base_url + '/apicast-tests/ping'

Expand Down Expand Up @@ -356,7 +356,7 @@ def _legacy_test_urls(self, url, method):
url = urlparse(url)
test_url = url.scheme + "://" + url.netloc
last_ex = None
paths = (url.path + '/', '', '/r', '/r/insights')
paths = (url.path, '', '/r', '/r/insights')
log_level = NETWORK if self.config.verbose else logging.DEBUG
for ext in paths:
try:
Expand Down Expand Up @@ -494,6 +494,7 @@ def test_connection(self, rc=0):

for description, url, method in [
("Uploading a file to Ingress", self.upload_url, "POST"),
("Getting hosts from Inventory", self.inventory_url + "/hosts", "GET"),
("Pinging the API", self.ping_url, "GET"),
]:
logger.info(" %s...", description)
Expand Down

0 comments on commit 8d81053

Please sign in to comment.