Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace “cloud.redhat.com” with “console.redhat.com” #3365

Merged
merged 1 commit into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions insights/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,9 +575,9 @@ def show_inventory_deep_link(self):
if len(system) == 1:
try:
id = system[0]["id"]
logger.info("View details about this system on cloud.redhat.com:")
logger.info("View details about this system on console.redhat.com:")
logger.info(
"https://cloud.redhat.com/insights/inventory/{0}".format(id)
"https://console.redhat.com/insights/inventory/{0}".format(id)
)
except Exception as e:
logger.error(
Expand Down
4 changes: 2 additions & 2 deletions insights/client/auto_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,10 @@ def try_auto_configuration(config):
_try_satellite5_configuration(config)
if not config.legacy_upload and re.match(r'(.+)?\/r\/insights', config.base_url):
# When to append /platform
# base url ~= cloud.redhat.com/r/insights
# base url ~= console.redhat.com/r/insights
# base url ~= cert-api.access.redhat.com/r/insights
# base url ~= satellite.host.example.com/redhat_access/r/insights
# When not to append /platform
# base url ~= cloud.redhat.com/api
# base url ~= console.redhat.com/api
config.base_url = config.base_url + '/platform'
logger.debug('Updated base_url: %s', config.base_url)
4 changes: 2 additions & 2 deletions insights/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def _legacy_upload(config, pconn, tar_file, content_type, collection_duration=No
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://cloud.redhat.com/insights/')
logger.info('View the Red Hat Insights console at https://console.redhat.com/insights/')
break

elif upload.status_code in (412, 413):
Expand Down Expand Up @@ -370,7 +370,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://cloud.redhat.com/insights/')
logger.info('View the Red Hat Insights console at https://console.redhat.com/insights/')
return
elif upload.status_code in (413, 415):
pconn.handle_fail_rcs(upload)
Expand Down
2 changes: 1 addition & 1 deletion insights/client/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def __init__(self, config):
self.base_url = protocol + constants.base_url
else:
self.base_url = protocol + self.config.base_url
# end hack. in the future, make cloud.redhat.com the default
# end hack. in the future, make console.redhat.com the default

self.upload_url = self.config.upload_url
if self.upload_url is None:
Expand Down
18 changes: 9 additions & 9 deletions insights/tests/client/auto_config/test_autoconfig_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_rhsm_platform_url(set_auto_configuration, initConfig):
initConfig().get.side_effect = ['subscription.rhsm.redhat.com', '443', '', '', '', '', '']
config = Mock(base_url=None, upload_url=None, legacy_upload=False)
_try_satellite6_configuration(config)
# set_auto_configuration.assert_called_with(config, 'cloud.redhat.com', None, None, False)
# set_auto_configuration.assert_called_with(config, 'console.redhat.com', None, None, False)
set_auto_configuration.assert_called_with(config, 'cert-api.access.redhat.com', None, None, False, False)


Expand Down Expand Up @@ -109,8 +109,8 @@ def test_rhsm_platform_base_url_configured():
Ensure the correct base URL is assembled for a platform RHSM upload
'''
config = Mock(base_url=None, upload_url=None, legacy_upload=False, proxy=None)
# set_auto_configuration(config, 'cloud.redhat.com', None, None, False)
# assert config.base_url == 'cloud.redhat.com/api'
# set_auto_configuration(config, 'console.redhat.com', None, None, False)
# assert config.base_url == 'console.redhat.com/api'
# [CIRCUS MUSIC]
set_auto_configuration(config, 'cert-api.access.redhat.com', None, None, False, False)
# assert config.base_url == 'cert-api.access.redhat.com/r/insights/platform'
Expand Down Expand Up @@ -182,15 +182,15 @@ def test_platform_path_added_cloud_redhat():
try_auto_configuration(config)
assert config.base_url == 'test.satellite.com:443/redhat_access/r/insights/platform'

# cloud.redhat.com compatibility layer - classic API hosted on c.rh.c
config = Mock(base_url='cloud.redhat.com/r/insights', auto_config=True, legacy_upload=False, offline=False)
# console.redhat.com compatibility layer - classic API hosted on c.rh.c
config = Mock(base_url='console.redhat.com/r/insights', auto_config=True, legacy_upload=False, offline=False)
try_auto_configuration(config)
assert config.base_url == 'cloud.redhat.com/r/insights/platform'
assert config.base_url == 'console.redhat.com/r/insights/platform'

# cloud.redhat.com API directly connected
config = Mock(base_url='cloud.redhat.com/api', auto_config=True, legacy_upload=False, offline=False)
# console.redhat.com API directly connected
config = Mock(base_url='console.redhat.com/api', auto_config=True, legacy_upload=False, offline=False)
try_auto_configuration(config)
assert config.base_url == 'cloud.redhat.com/api'
assert config.base_url == 'console.redhat.com/api'


@patch("insights.client.auto_config.verify_connectivity", Mock())
Expand Down
4 changes: 2 additions & 2 deletions insights/tests/client/connection/test_url_guess.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ def test_url_guess_platform(get_proxies, init_session):
config = Mock(base_url=None, upload_url=None, legacy_upload=False)

connection = InsightsConnection(config)
# assert connection.base_url == 'https://cloud.redhat.com/api'
# assert connection.base_url == 'https://console.redhat.com/api'
assert connection.base_url == 'https://cert-api.access.redhat.com/r/insights/platform'
# assert connection.upload_url == 'https://cloud.redhat.com/api/ingress/v1/upload'
# assert connection.upload_url == 'https://console.redhat.com/api/ingress/v1/upload'
assert connection.upload_url == 'https://cert-api.access.redhat.com/r/insights/platform/ingress/v1/upload'


Expand Down