Skip to content

Commit

Permalink
Fixing review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jyejare committed Mar 21, 2024
1 parent ec1a6a5 commit db345d7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
9 changes: 5 additions & 4 deletions pytest_fixtures/core/sat_cap_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,9 @@ def installer_satellite(request):
configure_airgun()
yield sat
if 'sanity' not in request.config.option.markexpr:
sat = Satellite(sat.hostname)
sat = Satellite.get_host_by_hostname(sat.hostname)
sat.unregister()
broker_sat = Satellite.get_host_by_hostname(sat.hostname)
Broker(hosts=[broker_sat]).checkin()
sat.disable_ipv6_http_proxy(http_proxy)
sat.disable_ipv6_http_proxy(http_proxy)
Broker(hosts=[sat]).checkin()
else:
sat.disable_ipv6_http_proxy(http_proxy)
27 changes: 13 additions & 14 deletions robottelo/hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -1616,7 +1616,7 @@ def enable_capsule_downstream_repos(self):
)

def enable_ipv6_http_proxy(self):
if settings.server.is_ipv6 and settings.server.http_proxy_ipv6_url:
if all([settings.server.is_ipv6, settings.server.http_proxy_ipv6_url]):
url = urlparse(settings.server.http_proxy_ipv6_url)
self.execute(
f'subscription-manager config --server.proxy_hostname={url.hostname} --server.proxy_port={url.port}'
Expand Down Expand Up @@ -1789,9 +1789,9 @@ def _swap_nailgun(self, new_version):

def enable_ipv6_http_proxy(self):
# Execute procedures for enabling IPv6 HTTP Proxy
if all[settings.server.is_ipv6, settings.server.http_proxy_ipv6_url]:
if all([settings.server.is_ipv6, settings.server.http_proxy_ipv6_url]):
proxy_name = 'Robottelo IPv6 Automation Proxy'
if self.cli.HttpProxy.exists(search=('name', proxy_name)):
if not self.cli.HttpProxy.exists(search=('name', proxy_name)):
http_proxy = self.cli.HttpProxy.create(
{
'name': proxy_name,
Expand All @@ -1804,25 +1804,24 @@ def enable_ipv6_http_proxy(self):
'value': proxy_name,
}
)
return http_proxy
else:
logger.info(
'The IPv6 HTTP Proxy is already enabled!! Skipping the IPv6 HTTP Proxy setup.'
'The IPv6 HTTP Proxy is already enabled. Skipping the IPv6 HTTP Proxy setup.'
)
http_proxy = self.cli.HttpProxy.list({'search': f'name={proxy_name}'})
if http_proxy:
return http_proxy[0]
return None
else:
logger.warning(
'The IPv6 HTTP Proxy setting is not enabled!! Skipping the IPv6 HTTP Proxy setup.'
)
return None
http_proxy = http_proxy[0]
return http_proxy
logger.warning(
'The IPv6 HTTP Proxy setting is not enabled. Skipping the IPv6 HTTP Proxy setup.'
)
return None

def disable_ipv6_http_proxy(self, http_proxy):
# Execute procedures for enabling IPv6 HTTP Proxy
"""
Execute procedures for disabling IPv6 HTTP Proxy
"""
if http_proxy:
# TO_DO: Enable only if its not already enabled
self.cli.HttpProxy.delete({'id': http_proxy['id']})
self.cli.Settings.set(
{
Expand Down

0 comments on commit db345d7

Please sign in to comment.