Skip to content

Commit

Permalink
fix(client): Display correct Insights URL
Browse files Browse the repository at this point in the history
* Card ID: CCT-1008

With the introduction of IoP, the `insights-client` should display the
correct URL for the respective environment. The client differentiates
between Hosted, Stage Hosted, and IoP environments during registration.

Signed-off-by: Peter Koprda <[email protected]>
  • Loading branch information
pkoprda committed Dec 5, 2024
1 parent 771ed57 commit 5c2522a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion insights/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ def upload(config, pconn, tar_file, content_type, collection_duration=None):
logger.info("Successfully uploaded report for %s.", msg_name)
if config.register:
# direct to console after register + upload
logger.info('View the Red Hat Insights console at https://console.redhat.com/insights/')
display_console_url(config)
return
elif upload.status_code in (413, 415):
pconn.handle_fail_rcs(upload)
Expand All @@ -428,3 +428,10 @@ def display_upload_error_and_retry(config, tries, error_message):
logger.error("All attempts to upload have failed!")
print("Please see %s for additional information" % config.logging_file)
raise RuntimeError('Upload failed.')


def display_console_url(config):
console_url = "https://console.redhat.com/insights/"
if "stage" in config.base_url:
console_url = "https://console.stage.redhat.com/insights/"
logger.info("View the Red Hat Insights console at %s" % console_url)

0 comments on commit 5c2522a

Please sign in to comment.