Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
r0x0d committed Jun 19, 2024
1 parent 7bca2bc commit 46dd982
Show file tree
Hide file tree
Showing 14 changed files with 1,591 additions and 1,501 deletions.
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 @@ -21,12 +21,12 @@

from convert2rhel import actions, backup, exceptions
from convert2rhel.backup.files import MissingFile, RestorableFile
from convert2rhel.cli import PRE_RPM_VA_LOG_FILENAME
from convert2rhel.logger import LOG_DIR
from convert2rhel.pkghandler import VERSIONLOCK_FILE_PATH
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


# Regex explanation:
Expand Down
412 changes: 412 additions & 0 deletions convert2rhel/cli.py

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions convert2rhel/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import logging
import os

from convert2rhel import actions, applock, backup, breadcrumbs, checks, exceptions, grub, hostmetering
from convert2rhel import actions, applock, backup, breadcrumbs, checks, cli, exceptions, grub, hostmetering
from convert2rhel import logger as logger_module
from convert2rhel import pkghandler, pkgmanager, redhatrelease, subscription, systeminfo, toolopts, utils
from convert2rhel.actions import level_for_raw_action_data, report
Expand Down Expand Up @@ -109,7 +109,7 @@ def main():
"""

# handle command line arguments
toolopts.CLI()
cli.CLI()

# Make sure we're being run by root
utils.require_root()
Expand Down
19 changes: 1 addition & 18 deletions convert2rhel/subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import os
import re

from functools import partial
from time import sleep

import dbus
Expand All @@ -35,7 +34,7 @@
from convert2rhel.redhatrelease import os_release_file
from convert2rhel.repo import DEFAULT_DNF_VARS_DIR, DEFAULT_YUM_VARS_DIR
from convert2rhel.systeminfo import system_info
from convert2rhel.toolopts import _should_subscribe, tool_opts
from convert2rhel.toolopts import tool_opts


loggerinst = logging.getLogger(__name__)
Expand Down Expand Up @@ -982,19 +981,3 @@ def get_rhsm_facts():
"Failed to get the RHSM facts : %s." % e,
)
return rhsm_facts


# subscription is the natural place to look for should_subscribe but it
# is needed by toolopts. So define it as a private function in toolopts but
# create a public identifier to access it here.

#: Whether we should subscribe the system with subscription-manager.
#:
#: If the user has specified some way to authenticate with subscription-manager
#: then we need to subscribe the system. If not, the assumption is that the
#: user has already subscribed the system or that this machine does not need to
#: subscribe to rhsm in order to get the RHEL rpm packages.
#:
#: :returns: Returns True if we need to subscribe the system, otherwise return False.
#: :rtype: bool
should_subscribe = partial(_should_subscribe, tool_opts)
3 changes: 2 additions & 1 deletion convert2rhel/systeminfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
from six.moves import configparser

from convert2rhel import logger, utils
from convert2rhel.toolopts import POST_RPM_VA_LOG_FILENAME, PRE_RPM_VA_LOG_FILENAME, tool_opts
from convert2rhel.cli import POST_RPM_VA_LOG_FILENAME, PRE_RPM_VA_LOG_FILENAME
from convert2rhel.toolopts import tool_opts
from convert2rhel.utils import run_subprocess


Expand Down
Loading

0 comments on commit 46dd982

Please sign in to comment.