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

[RHELC-1507] Port environment variables to config file #1272

Merged
merged 8 commits into from
Sep 19, 2024
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
12 changes: 12 additions & 0 deletions config/convert2rhel.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,15 @@
# password = <insert_password>
# activation_key = <insert_activation_key>
# org = <insert_org>

[host_metering]
# Possible values here are "auto" or "force"
# configure_host_metering = "auto"

[inhibitor_overrides]
# incomplete_rollback = false
# tainted_kernel_module_check_skip = false
# outdated_package_check_skip = false
# allow_older_version = false
# allow_unavailable_kmods = false
# skip_kernel_currency_check = false
2 changes: 2 additions & 0 deletions convert2rhel/actions/post_conversion/kernel_boot_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ def run(self):
# from `uname -r`, as it requires a reboot in order to take place, we are
# detecting the latest kernel by using `rpm` and figuring out which was the
# latest kernel installed.

latest_installed_kernel = output.split("\n")[0].split(" ")[0]
latest_installed_kernel = latest_installed_kernel[len(kernel_name + "-") :]

grub2_config_file = grub.get_grub_config_file()
initramfs_file = INITRAMFS_FILEPATH % latest_installed_kernel
vmlinuz_file = VMLINUZ_FILEPATH % latest_installed_kernel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from convert2rhel import actions, utils
from convert2rhel.logger import LOG_DIR, root_logger
from convert2rhel.systeminfo import system_info
from convert2rhel.toolopts import POST_RPM_VA_LOG_FILENAME, PRE_RPM_VA_LOG_FILENAME


logger = root_logger.getChild(__name__)
Expand All @@ -39,9 +38,9 @@ def run(self):

logger.task("Final: Show RPM files modified by the conversion")

system_info.generate_rpm_va(log_filename=POST_RPM_VA_LOG_FILENAME)
system_info.generate_rpm_va(log_filename=utils.rpm.POST_RPM_VA_LOG_FILENAME)

pre_rpm_va_log_path = os.path.join(LOG_DIR, PRE_RPM_VA_LOG_FILENAME)
pre_rpm_va_log_path = os.path.join(LOG_DIR, utils.rpm.PRE_RPM_VA_LOG_FILENAME)
if not os.path.exists(pre_rpm_va_log_path):
logger.info("Skipping comparison of the 'rpm -Va' output from before and after the conversion.")
self.add_message(
Expand All @@ -55,7 +54,7 @@ def run(self):
return

pre_rpm_va = utils.get_file_content(pre_rpm_va_log_path, True)
post_rpm_va_log_path = os.path.join(LOG_DIR, POST_RPM_VA_LOG_FILENAME)
post_rpm_va_log_path = os.path.join(LOG_DIR, utils.rpm.POST_RPM_VA_LOG_FILENAME)
post_rpm_va = utils.get_file_content(post_rpm_va_log_path, True)
modified_rpm_files_diff = "\n".join(
difflib.unified_diff(
Expand Down
2 changes: 1 addition & 1 deletion convert2rhel/actions/pre_ponr_changes/backup_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from convert2rhel.redhatrelease import os_release_file, system_release_file
from convert2rhel.repo import DEFAULT_DNF_VARS_DIR, DEFAULT_YUM_REPOFILE_DIR, DEFAULT_YUM_VARS_DIR
from convert2rhel.systeminfo import system_info
from convert2rhel.toolopts import PRE_RPM_VA_LOG_FILENAME
from convert2rhel.utils.rpm import PRE_RPM_VA_LOG_FILENAME


# Regex explanation:
Expand Down
5 changes: 3 additions & 2 deletions convert2rhel/breadcrumbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@

from datetime import datetime

from convert2rhel import pkghandler, toolopts, utils
from convert2rhel import pkghandler, utils
from convert2rhel.logger import root_logger
from convert2rhel.systeminfo import system_info
from convert2rhel.toolopts import tool_opts
from convert2rhel.utils import files


Expand Down Expand Up @@ -104,7 +105,7 @@ def finish_collection(self, success=False):

def _set_activity(self):
"""Set the activity that convert2rhel is going to perform"""
self.activity = toolopts.tool_opts.activity
self.activity = tool_opts.activity

def _set_pkg_object(self):
"""Set pkg_object which is used to get information about installed Convert2RHEL"""
Expand Down
Loading
Loading