-
Notifications
You must be signed in to change notification settings - Fork 115
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
use server deploy args #16921
Draft
rmynar
wants to merge
1
commit into
SatelliteQE:master
Choose a base branch
from
rmynar:fix-pit-srv-deploy
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+29
−14
Draft
use server deploy args #16921
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,16 @@ def resolve_deploy_args(args_dict): | |
if isinstance(val, str) and val.startswith('this.'): | ||
# Args transformed into small letters and existing capital args removed | ||
args_dict[key.lower()] = settings.get(args_dict.pop(key).replace('this.', '')) | ||
return args_dict | ||
return _remove_raw_keys(args_dict) | ||
|
||
|
||
def _remove_raw_keys(param): | ||
"""Recursively remove all keys that start with "raw_" which may break converting to json""" | ||
if isinstance(param, list): | ||
return [_remove_raw_keys(item) for item in param] | ||
if isinstance(param, dict): | ||
return {k: _remove_raw_keys(v) for k, v in param.items() if not k.startswith("raw_")} | ||
return param | ||
|
||
|
||
@contextmanager | ||
|
@@ -292,10 +301,10 @@ def parametrized_enrolled_sat( | |
Broker(hosts=[new_sat]).checkin() | ||
|
||
|
||
def get_deploy_args(request): | ||
"""Get deploy arguments for Satellite base OS deployment. Should not be used for Capsule.""" | ||
def get_sat_deploy_args(request): | ||
"""Get deploy arguments for Satellite base OS deployment.""" | ||
rhel_version = get_sat_rhel_version() | ||
deploy_args = settings.content_host[f'rhel{rhel_version.major}'].vm | { | ||
deploy_args = settings.server.deploy_arguments | { | ||
'deploy_rhel_version': rhel_version.base_version, | ||
'deploy_network_type': 'ipv6' if settings.server.is_ipv6 else 'ipv4', | ||
'deploy_flavor': settings.flavors.default, | ||
|
@@ -306,19 +315,31 @@ def get_deploy_args(request): | |
deploy_args.update(request.param) | ||
else: | ||
deploy_args['deploy_rhel_version'] = request.param | ||
return deploy_args | ||
return _remove_raw_keys(deploy_args) | ||
|
||
|
||
def get_cap_deploy_args(): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And this to capsule class as a class method? |
||
"""Get deploy arguments for Capsule base OS deployment.""" | ||
rhel_version = Version(settings.capsule.version.rhel_version) | ||
deploy_args = settings.capsule.deploy_arguments | { | ||
'deploy_rhel_version': rhel_version.base_version, | ||
'deploy_network_type': 'ipv6' if settings.server.is_ipv6 else 'ipv4', | ||
'deploy_flavor': settings.flavors.default, | ||
'workflow': settings.capsule.deploy_workflows.os, | ||
} | ||
return _remove_raw_keys(deploy_args) | ||
|
||
|
||
@pytest.fixture | ||
def sat_ready_rhel(request): | ||
deploy_args = get_deploy_args(request) | ||
deploy_args = get_sat_deploy_args(request) | ||
with Broker(**deploy_args, host_class=Satellite) as host: | ||
yield host | ||
|
||
|
||
@pytest.fixture(scope='module') | ||
def module_sat_ready_rhels(request, module_target_sat): | ||
deploy_args = get_deploy_args(request) | ||
deploy_args = get_sat_deploy_args(request) | ||
if 'build_sanity' not in request.config.option.markexpr: | ||
with Broker(**deploy_args, host_class=Satellite, _count=3) as hosts: | ||
yield hosts | ||
|
@@ -329,13 +350,7 @@ def module_sat_ready_rhels(request, module_target_sat): | |
@pytest.fixture | ||
def cap_ready_rhel(): | ||
"""Deploy bare RHEL system ready for Capsule installation.""" | ||
rhel_version = Version(settings.capsule.version.rhel_version) | ||
deploy_args = settings.capsule.deploy_arguments | { | ||
'deploy_rhel_version': rhel_version.base_version, | ||
'deploy_network_type': 'ipv6' if settings.server.is_ipv6 else 'ipv4', | ||
'deploy_flavor': settings.flavors.default, | ||
'workflow': settings.capsule.deploy_workflows.os, | ||
} | ||
deploy_args = get_cap_deploy_args() | ||
with Broker(**deploy_args, host_class=Capsule) as host: | ||
host.enable_ipv6_dnf_and_rhsm_proxy() | ||
yield host | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How if we move these to their own classes in
robottelo/hosts.py
module as class methods?Once moved, We/Anywhere these arguments could be used.