Skip to content

Commit

Permalink
Remove leftover analysis environment variable
Browse files Browse the repository at this point in the history
In the past, we introduced this environment variable to enable analysis
when it was in tech preview. Since we are not in that stage anymore, the
variable was left behind in the code after we started to remove all tech
preview code.
  • Loading branch information
r0x0d authored and Venefilyn committed Jun 18, 2024
1 parent f1d3a93 commit 56afb32
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 17 deletions.
12 changes: 2 additions & 10 deletions convert2rhel/toolopts.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,16 +336,8 @@ def _process_cli_options(self):
if parsed_opts.debug:
tool_opts.debug = True

if hasattr(parsed_opts, "command"):
# Once we use a subcommand to set the activity that convert2rhel will perform
tool_opts.activity = _COMMAND_TO_ACTIVITY[parsed_opts.command]
else:
# At first, in tech preview, we use an environment variable to set the activity.
experimental_analysis = bool(os.getenv("CONVERT2RHEL_EXPERIMENTAL_ANALYSIS", None))
if experimental_analysis:
tool_opts.activity = "analysis"
else:
tool_opts.activity = "conversion"
# Once we use a subcommand to set the activity that convert2rhel will perform
tool_opts.activity = _COMMAND_TO_ACTIVITY[parsed_opts.command]

# Processing the configuration file
conf_file_opts = options_from_config_files(parsed_opts.config_file)
Expand Down
2 changes: 0 additions & 2 deletions convert2rhel/unit_tests/main_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,6 @@ def test_main_rollback_analyze_exit_phase_without_subman(self, global_tool_opts,
(subscription, "should_subscribe", mock.Mock(side_effect=lambda: True)),
(subscription, "update_rhsm_custom_facts", mock.Mock()),
(main, "rollback_changes", mock.Mock()),
(os, "environ", {"CONVERT2RHEL_EXPERIMENTAL_ANALYSIS": 1}),
(report, "summary_as_json", mock.Mock()),
(report, "summary_as_txt", mock.Mock()),
)
Expand Down Expand Up @@ -618,7 +617,6 @@ def test_main_rollback_analyze_exit_phase(self, global_tool_opts, monkeypatch, t
monkeypatch.setattr(subscription, "should_subscribe", should_subscribe_mock)
monkeypatch.setattr(subscription, "update_rhsm_custom_facts", update_rhsm_custom_facts_mock)
monkeypatch.setattr(main, "rollback_changes", rollback_changes_mock)
monkeypatch.setattr(os, "environ", {"CONVERT2RHEL_EXPERIMENTAL_ANALYSIS": 1})
monkeypatch.setattr(report, "summary_as_json", summary_as_json_mock)
monkeypatch.setattr(report, "summary_as_txt", summary_as_txt_mock)
global_tool_opts.activity = "analysis"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ tag+:
Get right to the point of no return and end the conversion.
Verify that the system has been successfully unregistered after the rollback.
Verify that usermode, rhn-setup and os-release packages are not removed.
adjust+:
- environment+:
CONVERT2RHEL_EXPERIMENTAL_ANALYSIS: 1
when: distro == centos-8-latest
tag+:
- rhsm-cleanup
test: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def test_proper_rhsm_clean_up(shell, convert2rhel):
packages_to_remove_at_cleanup = install_packages(shell, assign_packages())

with convert2rhel(
"--serverurl {} --username {} --password {} --pool {} --debug".format(
"analyze --serverurl {} --username {} --password {} --pool {} --debug".format(
TEST_VARS["RHSM_SERVER_URL"],
TEST_VARS["RHSM_USERNAME"],
TEST_VARS["RHSM_PASSWORD"],
Expand Down

0 comments on commit 56afb32

Please sign in to comment.