Skip to content

Commit

Permalink
Preserve Capsule host for build sanity failures
Browse files Browse the repository at this point in the history
  • Loading branch information
jameerpathan111 authored and jyejare committed Dec 5, 2024
1 parent a2f2587 commit dde193f
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions pytest_fixtures/core/xdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pytest

from robottelo.config import configure_airgun, configure_nailgun, settings
from robottelo.hosts import Capsule, Satellite
from robottelo.hosts import ContentHost, Satellite
from robottelo.logging import logger


Expand All @@ -17,17 +17,12 @@ def align_to_satellite(request, worker_id, satellite_factory):
settings.set("server.hostname", None)
yield
# Checkout Sanity Capsule finally
if settings.capsule.hostname:
sanity_cap = Capsule.get_host_by_hostname(settings.capsule.hostname)
sanity_cap.unregister()
Broker(hosts=[sanity_cap]).checkin()
# Checkout Sanity Satellite finally
if settings.server.hostname:
sanity_sat = Satellite(settings.server.hostname)
sanity_sat.unregister()
if settings.server.auto_checkin:
broker_sat = Satellite.get_host_by_hostname(sanity_sat.hostname)
Broker(hosts=[broker_sat]).checkin()
for host in [settings.capsule.hostname, settings.server.hostname]:
if host:
sanity_host = ContentHost.get_host_by_hostname(host)
if settings.server.auto_checkin:
sanity_host.unregister()
Broker(hosts=[sanity_host]).checkin()
else:
# clear any hostname that may have been previously set
settings.set("server.hostname", None)
Expand Down

0 comments on commit dde193f

Please sign in to comment.