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

Remove nailgun entity_mixin import from discovery tests #15164

Merged
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
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
Loading