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 18, 2024
1 parent 765e21c commit 1f7879c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions insights/client/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,6 @@ def _legacy_test_urls(self, url, method):
for ext in paths:
try:
logger.info(" Testing %s", test_url + ext)
if ext == url.path + "/":
raise requests.exceptions.ConnectionError("errr")
if method == "POST":
test_req = self.post(test_url + ext, data=test_flag, log_prefix=" ", log_level=log_level)
elif method == "GET":
Expand All @@ -384,7 +382,6 @@ def _test_urls(self, url, method):
return self._legacy_test_urls(url, method)
try:
logger.info(' Testing %s', url)
# raise requests.exceptions.ConnectionError("errrrr")

log_prefix = " "
log_level = NETWORK if self.config.verbose else logging.DEBUG
Expand Down Expand Up @@ -492,6 +489,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 1f7879c

Please sign in to comment.