diff --git a/convert2rhel/toolopts.py b/convert2rhel/toolopts.py index df7394c1b8..20cd6494fc 100644 --- a/convert2rhel/toolopts.py +++ b/convert2rhel/toolopts.py @@ -311,15 +311,6 @@ def _add_subscription_manager_options(self): " 'subscription-manager list --available'." " If no pool ID is provided, the --auto option is used", ) - group.add_argument( - "-v", - "--variant", - help="This option is not supported anymore and has no effect. When" - " converting a system to RHEL 7 using subscription-manager," - " the system is now always converted to the Server variant. In case" - " of using custom repositories, the system is converted to the variant" - " provided by these repositories.", - ) group.add_argument( "--serverurl", help="Hostname of the subscription service to be used when registering the system with" @@ -332,8 +323,6 @@ def _process_cli_options(self): """Process command line options used with the tool.""" _log_command_used() - warn_on_unsupported_options() - # algorithm function to properly organize all CLI args argv = _add_default_command(sys.argv[1:]) parsed_opts = self._parser.parse_args(argv) @@ -512,15 +501,6 @@ def _process_cli_options(self): ) -def warn_on_unsupported_options(): - if any(x in sys.argv[1:] for x in ["--variant", "-v"]): - loggerinst.warning( - "The -v|--variant option is not supported anymore and has no effect.\n" - "See help (convert2rhel -h) for more information." - ) - utils.ask_to_continue() - - def _log_command_used(): """We want to log the command used for convert2rhel to make it easier to know what command was used when debugging the log files. Since we can't differentiate between the handlers we log to both stdout diff --git a/convert2rhel/unit_tests/toolopts_test.py b/convert2rhel/unit_tests/toolopts_test.py index 31d6c85615..a5beccc78b 100644 --- a/convert2rhel/unit_tests/toolopts_test.py +++ b/convert2rhel/unit_tests/toolopts_test.py @@ -139,31 +139,6 @@ def test_serverurl_with_no_rhsm_credentials(self, caplog, monkeypatch, global_to assert message in caplog.text -@pytest.mark.parametrize( - ("argv", "warn", "ask_to_continue"), - ( - (mock_cli_arguments(["-v", "Server"]), True, True), - (mock_cli_arguments(["--variant", "Client"]), True, True), - (mock_cli_arguments(["-v"]), True, True), - (mock_cli_arguments(["--variant"]), True, True), - (mock_cli_arguments(["--version"]), False, False), - (mock_cli_arguments([]), False, False), - ), -) -def test_cmdline_obsolete_variant_option(argv, warn, ask_to_continue, monkeypatch, caplog): - monkeypatch.setattr(sys, "argv", argv) - monkeypatch.setattr(convert2rhel.utils, "ask_to_continue", mock.Mock()) - convert2rhel.toolopts.warn_on_unsupported_options() - if warn: - assert "variant option is not supported" in caplog.text - else: - assert "variant option is not supported" not in caplog.text - if ask_to_continue: - convert2rhel.utils.ask_to_continue.assert_called_once() - else: - convert2rhel.utils.ask_to_continue.assert_not_called() - - @pytest.mark.parametrize( ("argv", "raise_exception", "no_rhsm_value"), ( diff --git a/man/convert2rhel.8 b/man/convert2rhel.8 index 1a5331bb27..f8a05e1ded 100644 --- a/man/convert2rhel.8 +++ b/man/convert2rhel.8 @@ -141,13 +141,6 @@ Subscription pool ID. A list of the available subscriptions is possible to obtain by running 'subscription\-manager list \-\-available'. If no pool ID is provided, the \-\-auto option is used -.TP -\fB\-v\fR \fI\,VARIANT\/\fR, \fB\-\-variant\fR \fI\,VARIANT\/\fR -This option is not supported anymore and has no effect. When converting a -system to RHEL 7 using subscription\-manager, the system is now always -converted to the Server variant. In case of using custom repositories, the -system is converted to the variant provided by these repositories. - .TP \fB\-\-serverurl\fR \fI\,SERVERURL\/\fR Hostname of the subscription service to be used when registering the system @@ -287,13 +280,6 @@ Subscription pool ID. A list of the available subscriptions is possible to obtain by running 'subscription\-manager list \-\-available'. If no pool ID is provided, the \-\-auto option is used -.TP -\fB\-v\fR \fI\,VARIANT\/\fR, \fB\-\-variant\fR \fI\,VARIANT\/\fR -This option is not supported anymore and has no effect. When converting a -system to RHEL 7 using subscription\-manager, the system is now always -converted to the Server variant. In case of using custom repositories, the -system is converted to the variant provided by these repositories. - .TP \fB\-\-serverurl\fR \fI\,SERVERURL\/\fR Hostname of the subscription service to be used when registering the system diff --git a/pytest.ini b/pytest.ini index e22f5371d9..fdd6e0a5c4 100644 --- a/pytest.ini +++ b/pytest.ini @@ -29,7 +29,6 @@ markers = test_version_older_with_envar test_clean_cache test_log_rhsm_error - test_variant_message test_data_collection_acknowledgement test_disable_data_collection test_analyze_incomplete_rollback diff --git a/tests/integration/tier0/non-destructive/basic-sanity-checks/main.fmf b/tests/integration/tier0/non-destructive/basic-sanity-checks/main.fmf index 2dda7b3bde..27c4e83190 100644 --- a/tests/integration/tier0/non-destructive/basic-sanity-checks/main.fmf +++ b/tests/integration/tier0/non-destructive/basic-sanity-checks/main.fmf @@ -6,7 +6,6 @@ description: | - Only last version of Convert2RHEL supported - Yum cache cleaned before any other check - Missing RHSM certificates logged properly - - Deprecated --variant message displayed tier: 0 @@ -122,17 +121,6 @@ tag+: pytest -svv -m test_log_rhsm_error -/variant_message: - summary+: | - Deprecated variant message - description+: | - Verify that the message about deprecated --variant option is printed. - tag+: - - variant-message - test: | - pytest -svv -m test_variant_message - - /data_collection: summary+: | Data collection sanity test diff --git a/tests/integration/tier0/non-destructive/basic-sanity-checks/test_basic_sanity_checks.py b/tests/integration/tier0/non-destructive/basic-sanity-checks/test_basic_sanity_checks.py index 171bc48186..bb7095c68a 100644 --- a/tests/integration/tier0/non-destructive/basic-sanity-checks/test_basic_sanity_checks.py +++ b/tests/integration/tier0/non-destructive/basic-sanity-checks/test_basic_sanity_checks.py @@ -239,36 +239,6 @@ def test_rhsm_error_logged(convert2rhel): assert "ERROR - OSError(2): No such file or directory" not in line -@pytest.mark.test_variant_message -def test_check_variant_message(convert2rhel): - """ - Run Convert2RHEL with deprecated -v/--variant option and verify that the warning message is shown. - """ - # Run c2r with --variant option - with convert2rhel("--debug --variant Server") as c2r: - c2r.expect("WARNING - The -v|--variant option is not supported anymore and has no effect") - c2r.sendcontrol("c") - assert c2r.exitstatus != 0 - - # Run c2r with --variant option empty - with convert2rhel("--debug --variant") as c2r: - c2r.expect("WARNING - The -v|--variant option is not supported anymore and has no effect") - c2r.sendcontrol("c") - assert c2r.exitstatus != 0 - - # Run c2r with -v option - with convert2rhel("--debug -v Client") as c2r: - c2r.expect("WARNING - The -v|--variant option is not supported anymore and has no effect") - c2r.sendcontrol("c") - assert c2r.exitstatus != 0 - - # Run c2r with -v option empty - with convert2rhel("--debug -v") as c2r: - c2r.expect("WARNING - The -v|--variant option is not supported anymore and has no effect") - c2r.sendcontrol("c") - assert c2r.exitstatus != 0 - - @pytest.mark.test_data_collection_acknowledgement def test_data_collection_acknowledgement(shell, convert2rhel): """