Skip to content

Commit

Permalink
[6.13.z] Remove nailgun entity_mixin import from discovery tests (#15246
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Satellite-QE authored May 30, 2024
1 parent 0508bb7 commit 6167f8f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions robottelo/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,15 @@ def get_url():
return urlunsplit((scheme, hostname, '', '', ''))


def admin_nailgun_config():
"""Return a NailGun configuration file constructed from default admin user credentials.
:return: ``nailgun.config.ServerConfig`` object, populated from admin user credentials.
"""
return ServerConfig(get_url(), get_credentials(), verify=settings.server.verify_ca)


def user_nailgun_config(username=None, password=None):
"""Return a NailGun configuration file constructed from default values.
Expand Down
4 changes: 2 additions & 2 deletions tests/foreman/destructive/test_discoveredhost.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
from copy import copy
import re

from nailgun import entity_mixins
import pytest
from wait_for import TimedOutError, wait_for

from robottelo.config import admin_nailgun_config
from robottelo.logging import logger

pytestmark = pytest.mark.destructive
Expand Down Expand Up @@ -124,7 +124,7 @@ def _assert_discovered_host(host, channel=None, user_config=None, sat=None):
# raise assertion error
raise AssertionError('Timed out waiting for "/facts" 201 response') from err

default_config = entity_mixins.DEFAULT_SERVER_CONFIG
default_config = admin_nailgun_config()

try:
wait_for(
Expand Down

0 comments on commit 6167f8f

Please sign in to comment.