From 5b338723a52e2215ff0a82590c59ad055b96f680 Mon Sep 17 00:00:00 2001 From: Matej Matuska Date: Tue, 14 Nov 2023 21:37:44 +0100 Subject: [PATCH] rename actors --- .../actor.py | 8 ++++---- .../libraries/applycustomdnfconf.py} | 0 .../tests/test_applycustomdnfconf.py} | 6 +++--- .../actor.py | 10 +++++----- .../libraries/copydnfconfintotargetuserspace.py} | 0 .../tests/test_dnfconfuserspacecopy.py | 8 ++++---- 6 files changed, 16 insertions(+), 16 deletions(-) rename repos/system_upgrade/common/actors/{dnfconftargetusecustom => applycustomdnfconf}/actor.py (71%) rename repos/system_upgrade/common/actors/{dnfconftargetusecustom/libraries/dnfconftargetusecustom.py => applycustomdnfconf/libraries/applycustomdnfconf.py} (100%) rename repos/system_upgrade/common/actors/{dnfconftargetusecustom/tests/test_dnfconftargetusecustom.py => applycustomdnfconf/tests/test_applycustomdnfconf.py} (69%) rename repos/system_upgrade/common/actors/{dnfconfuserspacecopy => copydnfconfintotargetuserspace}/actor.py (73%) rename repos/system_upgrade/common/actors/{dnfconfuserspacecopy/libraries/dnfconfuserspacecopy.py => copydnfconfintotargetuserspace/libraries/copydnfconfintotargetuserspace.py} (100%) rename repos/system_upgrade/common/actors/{dnfconfuserspacecopy => copydnfconfintotargetuserspace}/tests/test_dnfconfuserspacecopy.py (72%) diff --git a/repos/system_upgrade/common/actors/dnfconftargetusecustom/actor.py b/repos/system_upgrade/common/actors/applycustomdnfconf/actor.py similarity index 71% rename from repos/system_upgrade/common/actors/dnfconftargetusecustom/actor.py rename to repos/system_upgrade/common/actors/applycustomdnfconf/actor.py index 019a21e78c..d7c7fe878d 100644 --- a/repos/system_upgrade/common/actors/dnfconftargetusecustom/actor.py +++ b/repos/system_upgrade/common/actors/applycustomdnfconf/actor.py @@ -1,19 +1,19 @@ from leapp.actors import Actor -from leapp.libraries.actor import dnfconftargetusecustom +from leapp.libraries.actor import applycustomdnfconf from leapp.tags import ApplicationsPhaseTag, IPUWorkflowTag -class DNFConfTargetUseCustom(Actor): +class ApplyCustomDNFConf(Actor): """ Move /etc/leapp/files/dnf.conf to /etc/dnf/dnf.conf if it exists An actor in FactsPhase copies this file to the target userspace if present. In such case we also want to use the file on the target system. """ - name = "dnf_conf_target_use_custom" + name = "apply_custom_dnf_conf" consumes = () produces = () tags = (ApplicationsPhaseTag, IPUWorkflowTag) def process(self): - dnfconftargetusecustom.process() + applycustomdnfconf.process() diff --git a/repos/system_upgrade/common/actors/dnfconftargetusecustom/libraries/dnfconftargetusecustom.py b/repos/system_upgrade/common/actors/applycustomdnfconf/libraries/applycustomdnfconf.py similarity index 100% rename from repos/system_upgrade/common/actors/dnfconftargetusecustom/libraries/dnfconftargetusecustom.py rename to repos/system_upgrade/common/actors/applycustomdnfconf/libraries/applycustomdnfconf.py diff --git a/repos/system_upgrade/common/actors/dnfconftargetusecustom/tests/test_dnfconftargetusecustom.py b/repos/system_upgrade/common/actors/applycustomdnfconf/tests/test_applycustomdnfconf.py similarity index 69% rename from repos/system_upgrade/common/actors/dnfconftargetusecustom/tests/test_dnfconftargetusecustom.py rename to repos/system_upgrade/common/actors/applycustomdnfconf/tests/test_applycustomdnfconf.py index ab84b7f0f1..6dbc4291b9 100644 --- a/repos/system_upgrade/common/actors/dnfconftargetusecustom/tests/test_dnfconftargetusecustom.py +++ b/repos/system_upgrade/common/actors/applycustomdnfconf/tests/test_applycustomdnfconf.py @@ -2,7 +2,7 @@ import pytest -from leapp.libraries.actor import dnfconftargetusecustom +from leapp.libraries.actor import applycustomdnfconf @pytest.mark.parametrize( @@ -17,7 +17,7 @@ def test_copy_correct_dnf_conf(monkeypatch, exists, should_move): def mocked_run(_): run_called[0] = True - monkeypatch.setattr(dnfconftargetusecustom, 'run', mocked_run) + monkeypatch.setattr(applycustomdnfconf, 'run', mocked_run) - dnfconftargetusecustom.process() + applycustomdnfconf.process() assert run_called[0] == should_move diff --git a/repos/system_upgrade/common/actors/dnfconfuserspacecopy/actor.py b/repos/system_upgrade/common/actors/copydnfconfintotargetuserspace/actor.py similarity index 73% rename from repos/system_upgrade/common/actors/dnfconfuserspacecopy/actor.py rename to repos/system_upgrade/common/actors/copydnfconfintotargetuserspace/actor.py index 2142e1f102..46ce1934d2 100644 --- a/repos/system_upgrade/common/actors/dnfconfuserspacecopy/actor.py +++ b/repos/system_upgrade/common/actors/copydnfconfintotargetuserspace/actor.py @@ -1,12 +1,12 @@ from leapp.actors import Actor -from leapp.libraries.actor import dnfconfuserspacecopy +from leapp.libraries.actor import copydnfconfintotargetuserspace from leapp.models import TargetUserSpacePreupgradeTasks from leapp.tags import FactsPhaseTag, IPUWorkflowTag -class DNFConfUserspaceCopy(Actor): +class CopyDNFConfIntoTargetUserspace(Actor): """ - Copy dnf.conf to target userspace + Copy dnf.conf into target userspace Copies /etc/leapp/files/dnf.conf to target userspace. If it isn't available /etc/dnf/dnf.conf is copied instead. This allows specifying a different @@ -15,10 +15,10 @@ class DNFConfUserspaceCopy(Actor): example is incompatible proxy configuration between RHEL7 and RHEL8 DNF versions. """ - name = "dnf_conf_userspace_copy" + name = "copy_dnf_conf_into_target_userspace" consumes = () produces = (TargetUserSpacePreupgradeTasks,) tags = (FactsPhaseTag, IPUWorkflowTag) def process(self): - dnfconfuserspacecopy.process() + copydnfconfintotargetuserspace.process() diff --git a/repos/system_upgrade/common/actors/dnfconfuserspacecopy/libraries/dnfconfuserspacecopy.py b/repos/system_upgrade/common/actors/copydnfconfintotargetuserspace/libraries/copydnfconfintotargetuserspace.py similarity index 100% rename from repos/system_upgrade/common/actors/dnfconfuserspacecopy/libraries/dnfconfuserspacecopy.py rename to repos/system_upgrade/common/actors/copydnfconfintotargetuserspace/libraries/copydnfconfintotargetuserspace.py diff --git a/repos/system_upgrade/common/actors/dnfconfuserspacecopy/tests/test_dnfconfuserspacecopy.py b/repos/system_upgrade/common/actors/copydnfconfintotargetuserspace/tests/test_dnfconfuserspacecopy.py similarity index 72% rename from repos/system_upgrade/common/actors/dnfconfuserspacecopy/tests/test_dnfconfuserspacecopy.py rename to repos/system_upgrade/common/actors/copydnfconfintotargetuserspace/tests/test_dnfconfuserspacecopy.py index abe004cd5c..6c99925e0a 100644 --- a/repos/system_upgrade/common/actors/dnfconfuserspacecopy/tests/test_dnfconfuserspacecopy.py +++ b/repos/system_upgrade/common/actors/copydnfconfintotargetuserspace/tests/test_dnfconfuserspacecopy.py @@ -2,7 +2,7 @@ import pytest -from leapp.libraries.actor import dnfconfuserspacecopy +from leapp.libraries.actor import copydnfconfintotargetuserspace from leapp.libraries.common.testutils import logger_mocked, produce_mocked @@ -14,10 +14,10 @@ def test_copy_correct_dnf_conf(monkeypatch, userspace_conf_exists, expected): monkeypatch.setattr(os.path, "exists", lambda _: userspace_conf_exists) mocked_produce = produce_mocked() - monkeypatch.setattr(dnfconfuserspacecopy.api, 'produce', mocked_produce) - monkeypatch.setattr(dnfconfuserspacecopy.api, 'current_logger', logger_mocked()) + monkeypatch.setattr(copydnfconfintotargetuserspace.api, 'produce', mocked_produce) + monkeypatch.setattr(copydnfconfintotargetuserspace.api, 'current_logger', logger_mocked()) - dnfconfuserspacecopy.process() + copydnfconfintotargetuserspace.process() assert mocked_produce.called == 1 assert len(mocked_produce.model_instances) == 1