forked from rpms/leapp-repository
1324 lines
59 KiB
Diff
1324 lines
59 KiB
Diff
From 73d2f315114c05c1385c854da3b560be506479d6 Mon Sep 17 00:00:00 2001
|
|
From: Tomas Fratrik <tfratrik@redhat.com>
|
|
Date: Mon, 18 Aug 2025 11:09:30 +0200
|
|
Subject: [PATCH 38/55] pylint: enable useless-object-inheritance
|
|
|
|
Jira: RHELMISC-16038
|
|
---
|
|
.pylintrc | 1 -
|
|
commands/upgrade/breadcrumbs.py | 2 +-
|
|
.../tests/unit_test_addupgradebootentry.py | 4 ++--
|
|
.../adjustlocalrepos/tests/test_adjustlocalrepos.py | 4 ++--
|
|
.../tests/unit_test_applytransactionworkarounds.py | 2 +-
|
|
.../actors/biosdevname/tests/test_biosdevname.py | 6 +++---
|
|
.../tests/unit_test_checkbootavailspace.py | 2 +-
|
|
.../actors/checksaphana/tests/test_checksaphana.py | 6 +++---
|
|
.../checktargetrepos/tests/test_checktargetrepos.py | 2 +-
|
|
.../tests/test_convertgrubenvtofile.py | 2 +-
|
|
.../scanhybridimage/tests/test_scanhybridimage.py | 2 +-
|
|
.../tests/test_enablerhsmtargetrepos.py | 4 ++--
|
|
...aultboot_forcedefaultboottotargetkernelversion.py | 2 +-
|
|
.../tests/test_targetinitramfsgenerator.py | 2 +-
|
|
.../tests/unit_test_upgradeinitramfsgenerator.py | 6 +++---
|
|
.../tests/test_kernelcmdlineconfig.py | 2 +-
|
|
.../tests/test_image_generation.py | 2 +-
|
|
.../tests/test_livemode_userspace_modifications.py | 8 ++++----
|
|
.../actors/luksscanner/libraries/luksdump_parser.py | 4 ++--
|
|
.../actors/luksscanner/tests/test_luksscaner.py | 2 +-
|
|
.../tests/unit_test_migrateopensslconf.py | 8 ++++----
|
|
.../tests/test_persistentnetnames.py | 2 +-
|
|
.../tests/test_persistentnetnamesinitramfs.py | 2 +-
|
|
.../libraries/peseventsscanner_repomap.py | 2 +-
|
|
.../tests/unit_test_removebootfiles.py | 2 +-
|
|
.../tests/unit_test_removeupgradebootentry.py | 2 +-
|
|
.../libraries/repositoriesmapping.py | 2 +-
|
|
.../actors/rpmscanner/tests/test_rpmscanner.py | 2 +-
|
|
.../tests/unit_test_satellite_upgrader.py | 2 +-
|
|
.../tests/test_unit_scanclienablerepo.py | 2 +-
|
|
.../common/actors/scancpu/tests/test_scancpu.py | 2 +-
|
|
.../tests/test_scancustomrepofile.py | 2 +-
|
|
...stalledkernel_scaninstalledtargetkernelversion.py | 2 +-
|
|
.../actors/scansaphana/tests/test_scansaphana.py | 6 +++---
|
|
.../tests/unit_test_selinuxcontentscanner.py | 4 ++--
|
|
.../selinuxprepare/tests/unit_test_selinuxprepare.py | 2 +-
|
|
.../setetcreleasever/tests/test_setetcreleasever.py | 2 +-
|
|
.../libraries/setuptargetrepos_repomap.py | 2 +-
|
|
.../storagescanner/tests/unit_test_storagescanner.py | 4 ++--
|
|
.../tests/test_checksystemdbrokensymlinks.py | 2 +-
|
|
.../tests/test_repairsystemdsymlinks.py | 2 +-
|
|
.../tests/test_scansystemdsource.py | 2 +-
|
|
.../tests/test_scansystemdtarget.py | 2 +-
|
|
.../tests/test_setsystemdservicesstate.py | 2 +-
|
|
.../actors/systemfacts/tests/test_systemfacts.py | 4 ++--
|
|
.../systemfacts/tests/test_systemfacts_grub.py | 2 +-
|
|
.../systemfacts/tests/test_systemfacts_selinux.py | 2 +-
|
|
.../targetuserspacecreator/libraries/userspacegen.py | 2 +-
|
|
.../tests/unit_test_targetuserspacecreator.py | 4 ++--
|
|
.../tests/test_trustedgpgkeys.py | 2 +-
|
|
.../updategrubcore/tests/test_updategrubcore.py | 2 +-
|
|
.../tests/unit_test_verifycheckresults.py | 2 +-
|
|
.../xfsinfoscanner/tests/unit_test_xfsinfoscanner.py | 2 +-
|
|
repos/system_upgrade/common/libraries/grub.py | 4 ++--
|
|
repos/system_upgrade/common/libraries/kernel.py | 2 +-
|
|
repos/system_upgrade/common/libraries/mounting.py | 12 ++++++------
|
|
.../system_upgrade/common/libraries/multipathutil.py | 2 +-
|
|
repos/system_upgrade/common/libraries/rhui.py | 8 ++++----
|
|
repos/system_upgrade/common/libraries/rpms.py | 2 +-
|
|
.../common/libraries/tests/test_grub.py | 2 +-
|
|
.../common/libraries/tests/test_mdraid.py | 2 +-
|
|
.../tests/test_persistentnetnames_library.py | 4 ++--
|
|
.../common/libraries/tests/test_rhsm.py | 2 +-
|
|
repos/system_upgrade/common/libraries/testutils.py | 8 ++++----
|
|
.../tests/test_addarmbootloaderworkaround.py | 2 +-
|
|
.../tests/test_ensurevalidgrubcfghybrid.py | 2 +-
|
|
.../tests/test_grub2mkconfigonppc64.py | 4 ++--
|
|
.../tests/test_opensshdropindirectory_prepend.py | 2 +-
|
|
.../opensslproviders/tests/test_add_provider.py | 2 +-
|
|
.../tests/unit_test_scanblacklistca.py | 4 ++--
|
|
.../actors/sssdfacts/libraries/sssdfacts8to9.py | 2 +-
|
|
71 files changed, 107 insertions(+), 108 deletions(-)
|
|
|
|
diff --git a/.pylintrc b/.pylintrc
|
|
index 15a69461..d98ab151 100644
|
|
--- a/.pylintrc
|
|
+++ b/.pylintrc
|
|
@@ -44,7 +44,6 @@ disable=
|
|
too-many-lines, # we do not want to take care about that one
|
|
too-many-positional-arguments, # we cannot set yet max-possitional-arguments unfortunately
|
|
# new for python3 version of pylint
|
|
- useless-object-inheritance,
|
|
unnecessary-pass,
|
|
invalid-envvar-default, # pylint3 warnings envvar returns str/none by default
|
|
bad-option-value, # python 2 doesn't have import-outside-toplevel, but in some case we need to import outside toplevel
|
|
diff --git a/commands/upgrade/breadcrumbs.py b/commands/upgrade/breadcrumbs.py
|
|
index 3a3dcde3..1a90c143 100644
|
|
--- a/commands/upgrade/breadcrumbs.py
|
|
+++ b/commands/upgrade/breadcrumbs.py
|
|
@@ -36,7 +36,7 @@ def _flattened(d):
|
|
return dict(items)
|
|
|
|
|
|
-class _BreadCrumbs(object):
|
|
+class _BreadCrumbs:
|
|
def __init__(self, activity):
|
|
self._crumbs = {
|
|
'activity': activity,
|
|
diff --git a/repos/system_upgrade/common/actors/addupgradebootentry/tests/unit_test_addupgradebootentry.py b/repos/system_upgrade/common/actors/addupgradebootentry/tests/unit_test_addupgradebootentry.py
|
|
index e5f632bc..7341602b 100644
|
|
--- a/repos/system_upgrade/common/actors/addupgradebootentry/tests/unit_test_addupgradebootentry.py
|
|
+++ b/repos/system_upgrade/common/actors/addupgradebootentry/tests/unit_test_addupgradebootentry.py
|
|
@@ -24,7 +24,7 @@ from leapp.models import (
|
|
CUR_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
|
|
-class run_mocked(object):
|
|
+class run_mocked:
|
|
def __init__(self):
|
|
self.args = []
|
|
|
|
@@ -32,7 +32,7 @@ class run_mocked(object):
|
|
self.args.append(args)
|
|
|
|
|
|
-class write_to_file_mocked(object):
|
|
+class write_to_file_mocked:
|
|
def __init__(self):
|
|
self.content = None
|
|
|
|
diff --git a/repos/system_upgrade/common/actors/adjustlocalrepos/tests/test_adjustlocalrepos.py b/repos/system_upgrade/common/actors/adjustlocalrepos/tests/test_adjustlocalrepos.py
|
|
index 41cff200..6abf4189 100644
|
|
--- a/repos/system_upgrade/common/actors/adjustlocalrepos/tests/test_adjustlocalrepos.py
|
|
+++ b/repos/system_upgrade/common/actors/adjustlocalrepos/tests/test_adjustlocalrepos.py
|
|
@@ -83,7 +83,7 @@ def test_adjust_local_file_url(repo_file_line, expected_adjusted_repo_file_line)
|
|
assert adjusted_repo_file_line == expected_adjusted_repo_file_line
|
|
|
|
|
|
-class MockedFileDescriptor(object):
|
|
+class MockedFileDescriptor:
|
|
|
|
def __init__(self, repo_file, expected_new_repo_file):
|
|
self.repo_file = repo_file
|
|
@@ -113,7 +113,7 @@ class MockedFileDescriptor(object):
|
|
assert expected_repo_file_contents == new_contents
|
|
|
|
|
|
-class MockedContext(object):
|
|
+class MockedContext:
|
|
|
|
def __init__(self, repo_contents, expected_repo_contents):
|
|
self.repo_contents = repo_contents
|
|
diff --git a/repos/system_upgrade/common/actors/applytransactionworkarounds/tests/unit_test_applytransactionworkarounds.py b/repos/system_upgrade/common/actors/applytransactionworkarounds/tests/unit_test_applytransactionworkarounds.py
|
|
index 8fe33645..369514fc 100644
|
|
--- a/repos/system_upgrade/common/actors/applytransactionworkarounds/tests/unit_test_applytransactionworkarounds.py
|
|
+++ b/repos/system_upgrade/common/actors/applytransactionworkarounds/tests/unit_test_applytransactionworkarounds.py
|
|
@@ -18,7 +18,7 @@ class ShowMessageCurrentActorMocked(CurrentActorMocked):
|
|
self._show_messages.append(message)
|
|
|
|
|
|
-class MockedNotIsolatedActions(object):
|
|
+class MockedNotIsolatedActions:
|
|
def __init__(self):
|
|
self.called = 0
|
|
self.args = None
|
|
diff --git a/repos/system_upgrade/common/actors/biosdevname/tests/test_biosdevname.py b/repos/system_upgrade/common/actors/biosdevname/tests/test_biosdevname.py
|
|
index c60aa7a4..427eea54 100644
|
|
--- a/repos/system_upgrade/common/actors/biosdevname/tests/test_biosdevname.py
|
|
+++ b/repos/system_upgrade/common/actors/biosdevname/tests/test_biosdevname.py
|
|
@@ -9,7 +9,7 @@ from leapp.libraries.stdlib import api
|
|
from leapp.models import Interface, PCIAddress
|
|
|
|
|
|
-class LoggerMocked(object):
|
|
+class LoggerMocked:
|
|
def __init__(self):
|
|
self.infomsg = None
|
|
|
|
@@ -32,12 +32,12 @@ def test_biosdevname_enabled(monkeypatch):
|
|
assert not biosdevname.is_biosdevname_disabled()
|
|
|
|
|
|
-class pyudev_enum_mock(object):
|
|
+class pyudev_enum_mock:
|
|
def __init__(self, vendor):
|
|
self.vendor = vendor
|
|
|
|
def match_sys_name(self, _):
|
|
- class dev(object):
|
|
+ class dev:
|
|
attributes = {'sys_vendor': self.vendor}
|
|
|
|
return [dev()]
|
|
diff --git a/repos/system_upgrade/common/actors/checkbootavailspace/tests/unit_test_checkbootavailspace.py b/repos/system_upgrade/common/actors/checkbootavailspace/tests/unit_test_checkbootavailspace.py
|
|
index 094164c7..fbcd0820 100644
|
|
--- a/repos/system_upgrade/common/actors/checkbootavailspace/tests/unit_test_checkbootavailspace.py
|
|
+++ b/repos/system_upgrade/common/actors/checkbootavailspace/tests/unit_test_checkbootavailspace.py
|
|
@@ -10,7 +10,7 @@ from leapp.libraries.common.testutils import create_report_mocked
|
|
from leapp.utils.report import is_inhibitor
|
|
|
|
|
|
-class fake_get_avail_bytes_on_boot(object):
|
|
+class fake_get_avail_bytes_on_boot:
|
|
def __init__(self, size):
|
|
self.size = size
|
|
|
|
diff --git a/repos/system_upgrade/common/actors/checksaphana/tests/test_checksaphana.py b/repos/system_upgrade/common/actors/checksaphana/tests/test_checksaphana.py
|
|
index 1e43f403..29e9c930 100644
|
|
--- a/repos/system_upgrade/common/actors/checksaphana/tests/test_checksaphana.py
|
|
+++ b/repos/system_upgrade/common/actors/checksaphana/tests/test_checksaphana.py
|
|
@@ -97,7 +97,7 @@ def _parse_manifest_data(manifest):
|
|
return result
|
|
|
|
|
|
-class MockSapHanaInstanceInfo(object):
|
|
+class MockSapHanaInstanceInfo:
|
|
def __init__(self, name, number, path, admin, manifest_data, running=True):
|
|
self.manifest = _parse_manifest_data(manifest_data)
|
|
self.name = name
|
|
@@ -118,7 +118,7 @@ def _gen_instance_info(name, manifest_data, index, running=True):
|
|
)
|
|
|
|
|
|
-class MockSapHanaInfo(object):
|
|
+class MockSapHanaInfo:
|
|
def __init__(self, v1names, v2names, v2lownames, running=None):
|
|
self.installed = bool(v1names or v2names or v2lownames)
|
|
self.running = running if running is not None else self.installed
|
|
@@ -151,7 +151,7 @@ def _consume_mock_sap_hana_info(v1names=(), v2names=(), v2lownames=(), running=T
|
|
return _consume
|
|
|
|
|
|
-class MockSAPHanaVersionInstance(object):
|
|
+class MockSAPHanaVersionInstance:
|
|
def __init__(self, major, rev, patchlevel):
|
|
self.name = "TestName"
|
|
|
|
diff --git a/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py b/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py
|
|
index e055b3a6..dfe5d06a 100644
|
|
--- a/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py
|
|
+++ b/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py
|
|
@@ -16,7 +16,7 @@ from leapp.utils.deprecation import suppress_deprecation
|
|
from leapp.utils.report import is_inhibitor
|
|
|
|
|
|
-class MockedConsume(object):
|
|
+class MockedConsume:
|
|
def __init__(self, *args):
|
|
self._msgs = []
|
|
for arg in args:
|
|
diff --git a/repos/system_upgrade/common/actors/cloud/convertgrubenvtofile/tests/test_convertgrubenvtofile.py b/repos/system_upgrade/common/actors/cloud/convertgrubenvtofile/tests/test_convertgrubenvtofile.py
|
|
index c4534bd6..257060cc 100644
|
|
--- a/repos/system_upgrade/common/actors/cloud/convertgrubenvtofile/tests/test_convertgrubenvtofile.py
|
|
+++ b/repos/system_upgrade/common/actors/cloud/convertgrubenvtofile/tests/test_convertgrubenvtofile.py
|
|
@@ -14,7 +14,7 @@ def raise_call_error(args=None):
|
|
)
|
|
|
|
|
|
-class run_mocked(object):
|
|
+class run_mocked:
|
|
def __init__(self, raise_err=False):
|
|
self.called = 0
|
|
self.args = []
|
|
diff --git a/repos/system_upgrade/common/actors/cloud/scanhybridimage/tests/test_scanhybridimage.py b/repos/system_upgrade/common/actors/cloud/scanhybridimage/tests/test_scanhybridimage.py
|
|
index a0f6fd4c..660a1382 100644
|
|
--- a/repos/system_upgrade/common/actors/cloud/scanhybridimage/tests/test_scanhybridimage.py
|
|
+++ b/repos/system_upgrade/common/actors/cloud/scanhybridimage/tests/test_scanhybridimage.py
|
|
@@ -36,7 +36,7 @@ def raise_call_error(args=None):
|
|
)
|
|
|
|
|
|
-class run_mocked(object):
|
|
+class run_mocked:
|
|
def __init__(self, hypervisor='', raise_err=False):
|
|
self.hypervisor = hypervisor
|
|
self.called = 0
|
|
diff --git a/repos/system_upgrade/common/actors/enablerhsmtargetrepos/tests/test_enablerhsmtargetrepos.py b/repos/system_upgrade/common/actors/enablerhsmtargetrepos/tests/test_enablerhsmtargetrepos.py
|
|
index 12d53d26..f7b3f34a 100644
|
|
--- a/repos/system_upgrade/common/actors/enablerhsmtargetrepos/tests/test_enablerhsmtargetrepos.py
|
|
+++ b/repos/system_upgrade/common/actors/enablerhsmtargetrepos/tests/test_enablerhsmtargetrepos.py
|
|
@@ -13,7 +13,7 @@ from leapp.models import EnvVar, UsedTargetRepositories, UsedTargetRepository
|
|
def not_isolated_actions(raise_err=False):
|
|
commands_called = []
|
|
|
|
- class MockNotIsolatedActions(object):
|
|
+ class MockNotIsolatedActions:
|
|
def __init__(self, base_dir=None):
|
|
pass
|
|
|
|
@@ -33,7 +33,7 @@ def raise_call_error(args=None):
|
|
)
|
|
|
|
|
|
-class run_mocked(object):
|
|
+class run_mocked:
|
|
def __init__(self, raise_err=False):
|
|
self.called = 0
|
|
self.args = []
|
|
diff --git a/repos/system_upgrade/common/actors/forcedefaultboottotargetkernelversion/tests/test_forcedefaultboot_forcedefaultboottotargetkernelversion.py b/repos/system_upgrade/common/actors/forcedefaultboottotargetkernelversion/tests/test_forcedefaultboot_forcedefaultboottotargetkernelversion.py
|
|
index b903df45..a39e29a7 100644
|
|
--- a/repos/system_upgrade/common/actors/forcedefaultboottotargetkernelversion/tests/test_forcedefaultboot_forcedefaultboottotargetkernelversion.py
|
|
+++ b/repos/system_upgrade/common/actors/forcedefaultboottotargetkernelversion/tests/test_forcedefaultboot_forcedefaultboottotargetkernelversion.py
|
|
@@ -69,7 +69,7 @@ initrd=/boot/initramfs-{kernel_version}.img
|
|
'''
|
|
|
|
|
|
-class MockedRun(object):
|
|
+class MockedRun:
|
|
def __init__(self, case):
|
|
self.case = case
|
|
self.called_setdefault = False
|
|
diff --git a/repos/system_upgrade/common/actors/initramfs/targetinitramfsgenerator/tests/test_targetinitramfsgenerator.py b/repos/system_upgrade/common/actors/initramfs/targetinitramfsgenerator/tests/test_targetinitramfsgenerator.py
|
|
index b4c9dd89..4df9a485 100644
|
|
--- a/repos/system_upgrade/common/actors/initramfs/targetinitramfsgenerator/tests/test_targetinitramfsgenerator.py
|
|
+++ b/repos/system_upgrade/common/actors/initramfs/targetinitramfsgenerator/tests/test_targetinitramfsgenerator.py
|
|
@@ -33,7 +33,7 @@ def raise_call_error(args=None):
|
|
})
|
|
|
|
|
|
-class RunMocked(object):
|
|
+class RunMocked:
|
|
|
|
def __init__(self, raise_err=False):
|
|
self.called = 0
|
|
diff --git a/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/tests/unit_test_upgradeinitramfsgenerator.py b/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/tests/unit_test_upgradeinitramfsgenerator.py
|
|
index 8408233e..185cd4f0 100644
|
|
--- a/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/tests/unit_test_upgradeinitramfsgenerator.py
|
|
+++ b/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/tests/unit_test_upgradeinitramfsgenerator.py
|
|
@@ -82,7 +82,7 @@ def gen_UDM_list(data):
|
|
return [UpgradeDracutModule(name=i[0], module_path=i[1]) for i in data]
|
|
|
|
|
|
-class MockedContext(object):
|
|
+class MockedContext:
|
|
def __init__(self):
|
|
self.called_copy_from = []
|
|
self.called_copytree_from = []
|
|
@@ -174,7 +174,7 @@ def test_copy_boot_files(monkeypatch, arch):
|
|
assert actual_boot_content == bootc
|
|
|
|
|
|
-class MockedCopyArgs(object):
|
|
+class MockedCopyArgs:
|
|
def __init__(self):
|
|
self.args = None
|
|
|
|
@@ -250,7 +250,7 @@ def test_prepare_userspace_for_initram(monkeypatch, adjust_cwd, input_msgs, pkgs
|
|
assert _sort_files(upgradeinitramfsgenerator._copy_files.args[1]) == _files
|
|
|
|
|
|
-class MockedGetFspace(object):
|
|
+class MockedGetFspace:
|
|
def __init__(self, space):
|
|
self.space = space
|
|
|
|
diff --git a/repos/system_upgrade/common/actors/kernelcmdlineconfig/tests/test_kernelcmdlineconfig.py b/repos/system_upgrade/common/actors/kernelcmdlineconfig/tests/test_kernelcmdlineconfig.py
|
|
index e5759a7b..b7e51833 100644
|
|
--- a/repos/system_upgrade/common/actors/kernelcmdlineconfig/tests/test_kernelcmdlineconfig.py
|
|
+++ b/repos/system_upgrade/common/actors/kernelcmdlineconfig/tests/test_kernelcmdlineconfig.py
|
|
@@ -34,7 +34,7 @@ SAMPLE_GRUBBY_INFO_OUTPUT = TEMPLATE_GRUBBY_INFO_OUTPUT.format(SAMPLE_KERNEL_ARG
|
|
# pylint: enable=E501
|
|
|
|
|
|
-class MockedRun(object):
|
|
+class MockedRun:
|
|
def __init__(self, outputs=None):
|
|
"""
|
|
Mock stdlib.run().
|
|
diff --git a/repos/system_upgrade/common/actors/livemode/liveimagegenerator/tests/test_image_generation.py b/repos/system_upgrade/common/actors/livemode/liveimagegenerator/tests/test_image_generation.py
|
|
index 16ae0a09..e3ddce48 100644
|
|
--- a/repos/system_upgrade/common/actors/livemode/liveimagegenerator/tests/test_image_generation.py
|
|
+++ b/repos/system_upgrade/common/actors/livemode/liveimagegenerator/tests/test_image_generation.py
|
|
@@ -68,7 +68,7 @@ def test_generate_live_image_if_enabled(monkeypatch, livemode_config, should_pro
|
|
actor_mock = CurrentActorMocked(msgs=messages)
|
|
monkeypatch.setattr(api, 'current_actor', actor_mock)
|
|
|
|
- class NspawnMock(object):
|
|
+ class NspawnMock:
|
|
def __init__(self, *args, **kwargs):
|
|
pass
|
|
|
|
diff --git a/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/tests/test_livemode_userspace_modifications.py b/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/tests/test_livemode_userspace_modifications.py
|
|
index 58046b61..e890f45a 100644
|
|
--- a/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/tests/test_livemode_userspace_modifications.py
|
|
+++ b/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/tests/test_livemode_userspace_modifications.py
|
|
@@ -26,7 +26,7 @@ _LiveModeConfig = functools.partial(LiveModeConfig, squashfs_fullpath='<squashfs
|
|
def test_modifications_require_livemode_enabled(monkeypatch, livemode_config, should_modify):
|
|
monkeypatch.setattr(api, 'produce', produce_mocked())
|
|
|
|
- class NspawnActionsMock(object):
|
|
+ class NspawnActionsMock:
|
|
def __init__(self, *arg, **kwargs):
|
|
pass
|
|
|
|
@@ -82,7 +82,7 @@ class ActionType(enum.Enum):
|
|
CHMOD = 5
|
|
|
|
|
|
-class WriterMock(object):
|
|
+class WriterMock:
|
|
def __init__(self, action_log):
|
|
self.action_log = action_log
|
|
|
|
@@ -91,7 +91,7 @@ class WriterMock(object):
|
|
self.action_log.append(action)
|
|
|
|
|
|
-class FileHandleMock(object):
|
|
+class FileHandleMock:
|
|
def __init__(self, action_log):
|
|
self.action_log = action_log
|
|
|
|
@@ -102,7 +102,7 @@ class FileHandleMock(object):
|
|
pass
|
|
|
|
|
|
-class NspawnActionsMock(object):
|
|
+class NspawnActionsMock:
|
|
def __init__(self, base_dir, action_log):
|
|
self.base_dir = base_dir
|
|
self.action_log = action_log
|
|
diff --git a/repos/system_upgrade/common/actors/luksscanner/libraries/luksdump_parser.py b/repos/system_upgrade/common/actors/luksscanner/libraries/luksdump_parser.py
|
|
index 44113d0e..1f59b4d6 100755
|
|
--- a/repos/system_upgrade/common/actors/luksscanner/libraries/luksdump_parser.py
|
|
+++ b/repos/system_upgrade/common/actors/luksscanner/libraries/luksdump_parser.py
|
|
@@ -1,10 +1,10 @@
|
|
-class LuksDumpParser(object):
|
|
+class LuksDumpParser:
|
|
"""
|
|
Class for parsing "cryptsetup luksDump" output. Given a list of lines, it
|
|
generates a dictionary representing the dump.
|
|
"""
|
|
|
|
- class Node(object):
|
|
+ class Node:
|
|
"""
|
|
Helper class, every line is represented as a node. The node depth is
|
|
based on the indentation of the line. A dictionary is produced after
|
|
diff --git a/repos/system_upgrade/common/actors/luksscanner/tests/test_luksscaner.py b/repos/system_upgrade/common/actors/luksscanner/tests/test_luksscaner.py
|
|
index 22eb0946..dca6f26f 100644
|
|
--- a/repos/system_upgrade/common/actors/luksscanner/tests/test_luksscaner.py
|
|
+++ b/repos/system_upgrade/common/actors/luksscanner/tests/test_luksscaner.py
|
|
@@ -29,7 +29,7 @@ CLEVIS_KEYSLOTS = {
|
|
}
|
|
|
|
|
|
-class MockedRun(object):
|
|
+class MockedRun:
|
|
"""Simple mock class for leapp.libraries.stdlib.run."""
|
|
|
|
def __init__(self, variant, clevis_keyslots):
|
|
diff --git a/repos/system_upgrade/common/actors/openssl/migrateopensslconf/tests/unit_test_migrateopensslconf.py b/repos/system_upgrade/common/actors/openssl/migrateopensslconf/tests/unit_test_migrateopensslconf.py
|
|
index e9200312..18827a25 100644
|
|
--- a/repos/system_upgrade/common/actors/openssl/migrateopensslconf/tests/unit_test_migrateopensslconf.py
|
|
+++ b/repos/system_upgrade/common/actors/openssl/migrateopensslconf/tests/unit_test_migrateopensslconf.py
|
|
@@ -7,7 +7,7 @@ from leapp.libraries.common.testutils import CurrentActorMocked, logger_mocked
|
|
from leapp.libraries.stdlib import CalledProcessError
|
|
|
|
|
|
-class PathExistsMocked(object):
|
|
+class PathExistsMocked:
|
|
def __init__(self, existing_files=None):
|
|
self.called = 0
|
|
self._existing_files = existing_files if existing_files else []
|
|
@@ -17,7 +17,7 @@ class PathExistsMocked(object):
|
|
return fpath in self._existing_files
|
|
|
|
|
|
-class IsOpensslModifiedMocked(object):
|
|
+class IsOpensslModifiedMocked:
|
|
def __init__(self, ret_values):
|
|
self._ret_values = ret_values
|
|
# ret_values is list of bools to return on each call. ret_values.pop(0)
|
|
@@ -32,7 +32,7 @@ class IsOpensslModifiedMocked(object):
|
|
return self._ret_values.pop(0)
|
|
|
|
|
|
-class SafeMVFileMocked(object):
|
|
+class SafeMVFileMocked:
|
|
def __init__(self, ret_values):
|
|
self._ret_values = ret_values
|
|
# ret_values is list of bools to return on each call. ret_values.pop(0)
|
|
@@ -113,7 +113,7 @@ def test_migrate_openssl_failed_restore(monkeypatch):
|
|
assert len(migrateopensslconf.api.current_logger.errmsg) == 2
|
|
|
|
|
|
-class MockedRun(object):
|
|
+class MockedRun:
|
|
def __init__(self, raise_err):
|
|
self.called = 0
|
|
self.args = None
|
|
diff --git a/repos/system_upgrade/common/actors/persistentnetnames/tests/test_persistentnetnames.py b/repos/system_upgrade/common/actors/persistentnetnames/tests/test_persistentnetnames.py
|
|
index 40f54d0d..ffea5983 100644
|
|
--- a/repos/system_upgrade/common/actors/persistentnetnames/tests/test_persistentnetnames.py
|
|
+++ b/repos/system_upgrade/common/actors/persistentnetnames/tests/test_persistentnetnames.py
|
|
@@ -21,7 +21,7 @@ def interface_mocked(i=0):
|
|
)
|
|
|
|
|
|
-class interfaces_mocked(object):
|
|
+class interfaces_mocked:
|
|
def __init__(self, count):
|
|
self.count = count
|
|
|
|
diff --git a/repos/system_upgrade/common/actors/persistentnetnamesinitramfs/tests/test_persistentnetnamesinitramfs.py b/repos/system_upgrade/common/actors/persistentnetnamesinitramfs/tests/test_persistentnetnamesinitramfs.py
|
|
index 8da0dce4..f149502b 100644
|
|
--- a/repos/system_upgrade/common/actors/persistentnetnamesinitramfs/tests/test_persistentnetnamesinitramfs.py
|
|
+++ b/repos/system_upgrade/common/actors/persistentnetnamesinitramfs/tests/test_persistentnetnamesinitramfs.py
|
|
@@ -21,7 +21,7 @@ def interface_mocked(i=0):
|
|
)
|
|
|
|
|
|
-class interfaces_mocked(object):
|
|
+class interfaces_mocked:
|
|
def __init__(self, count):
|
|
self.count = count
|
|
|
|
diff --git a/repos/system_upgrade/common/actors/peseventsscanner/libraries/peseventsscanner_repomap.py b/repos/system_upgrade/common/actors/peseventsscanner/libraries/peseventsscanner_repomap.py
|
|
index 37be03f1..b3f35d99 100644
|
|
--- a/repos/system_upgrade/common/actors/peseventsscanner/libraries/peseventsscanner_repomap.py
|
|
+++ b/repos/system_upgrade/common/actors/peseventsscanner/libraries/peseventsscanner_repomap.py
|
|
@@ -18,7 +18,7 @@ def _get_channel_prio(pesid_repo):
|
|
return priorities.get(pesid_repo.channel, 10)
|
|
|
|
|
|
-class RepoMapDataHandler(object):
|
|
+class RepoMapDataHandler:
|
|
"""
|
|
Provide the basic functionality to work with the repository data easily.
|
|
"""
|
|
diff --git a/repos/system_upgrade/common/actors/removebootfiles/tests/unit_test_removebootfiles.py b/repos/system_upgrade/common/actors/removebootfiles/tests/unit_test_removebootfiles.py
|
|
index 7e5fbbf0..719ffe21 100644
|
|
--- a/repos/system_upgrade/common/actors/removebootfiles/tests/unit_test_removebootfiles.py
|
|
+++ b/repos/system_upgrade/common/actors/removebootfiles/tests/unit_test_removebootfiles.py
|
|
@@ -7,7 +7,7 @@ from leapp.libraries.stdlib import api
|
|
from leapp.models import BootContent
|
|
|
|
|
|
-class remove_file_mocked(object):
|
|
+class remove_file_mocked:
|
|
def __init__(self):
|
|
self.called = 0
|
|
self.files_to_remove = []
|
|
diff --git a/repos/system_upgrade/common/actors/removeupgradebootentry/tests/unit_test_removeupgradebootentry.py b/repos/system_upgrade/common/actors/removeupgradebootentry/tests/unit_test_removeupgradebootentry.py
|
|
index c84d3085..9de4e4d3 100644
|
|
--- a/repos/system_upgrade/common/actors/removeupgradebootentry/tests/unit_test_removeupgradebootentry.py
|
|
+++ b/repos/system_upgrade/common/actors/removeupgradebootentry/tests/unit_test_removeupgradebootentry.py
|
|
@@ -8,7 +8,7 @@ from leapp.libraries.stdlib import api
|
|
from leapp.models import ArmWorkaroundEFIBootloaderInfo, BootContent, EFIBootEntry, FirmwareFacts
|
|
|
|
|
|
-class run_mocked(object):
|
|
+class run_mocked:
|
|
def __init__(self):
|
|
self.args = []
|
|
|
|
diff --git a/repos/system_upgrade/common/actors/repositoriesmapping/libraries/repositoriesmapping.py b/repos/system_upgrade/common/actors/repositoriesmapping/libraries/repositoriesmapping.py
|
|
index d4a64793..503e66a3 100644
|
|
--- a/repos/system_upgrade/common/actors/repositoriesmapping/libraries/repositoriesmapping.py
|
|
+++ b/repos/system_upgrade/common/actors/repositoriesmapping/libraries/repositoriesmapping.py
|
|
@@ -16,7 +16,7 @@ REPOMAP_FILE = 'repomap.json'
|
|
"""The name of the new repository mapping file."""
|
|
|
|
|
|
-class RepoMapData(object):
|
|
+class RepoMapData:
|
|
VERSION_FORMAT = '1.3.0'
|
|
|
|
def __init__(self):
|
|
diff --git a/repos/system_upgrade/common/actors/rpmscanner/tests/test_rpmscanner.py b/repos/system_upgrade/common/actors/rpmscanner/tests/test_rpmscanner.py
|
|
index 3a59535b..e9455feb 100644
|
|
--- a/repos/system_upgrade/common/actors/rpmscanner/tests/test_rpmscanner.py
|
|
+++ b/repos/system_upgrade/common/actors/rpmscanner/tests/test_rpmscanner.py
|
|
@@ -77,7 +77,7 @@ ARTIFACTS_SUBVERSION_113 = [
|
|
]
|
|
|
|
|
|
-class ModuleMocked(object):
|
|
+class ModuleMocked:
|
|
def __init__(self, name, stream, artifacts):
|
|
self.name = name
|
|
self.stream = stream
|
|
diff --git a/repos/system_upgrade/common/actors/satellite_upgrader/tests/unit_test_satellite_upgrader.py b/repos/system_upgrade/common/actors/satellite_upgrader/tests/unit_test_satellite_upgrader.py
|
|
index 55896c75..f3bed932 100644
|
|
--- a/repos/system_upgrade/common/actors/satellite_upgrader/tests/unit_test_satellite_upgrader.py
|
|
+++ b/repos/system_upgrade/common/actors/satellite_upgrader/tests/unit_test_satellite_upgrader.py
|
|
@@ -4,7 +4,7 @@ from leapp.models import SatelliteFacts, SatellitePostgresqlFacts
|
|
from leapp.snactor.fixture import current_actor_context
|
|
|
|
|
|
-class MockedRun(object):
|
|
+class MockedRun:
|
|
def __init__(self):
|
|
self._manager = Manager()
|
|
self.commands = self._manager.list()
|
|
diff --git a/repos/system_upgrade/common/actors/scanclienablerepo/tests/test_unit_scanclienablerepo.py b/repos/system_upgrade/common/actors/scanclienablerepo/tests/test_unit_scanclienablerepo.py
|
|
index 1f437c47..6cf7e681 100644
|
|
--- a/repos/system_upgrade/common/actors/scanclienablerepo/tests/test_unit_scanclienablerepo.py
|
|
+++ b/repos/system_upgrade/common/actors/scanclienablerepo/tests/test_unit_scanclienablerepo.py
|
|
@@ -6,7 +6,7 @@ from leapp.libraries.stdlib import api
|
|
from leapp.models import CustomTargetRepository
|
|
|
|
|
|
-class LoggerMocked(object):
|
|
+class LoggerMocked:
|
|
def __init__(self):
|
|
self.infomsg = None
|
|
self.debugmsg = None
|
|
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/test_scancpu.py b/repos/system_upgrade/common/actors/scancpu/tests/test_scancpu.py
|
|
index dc9d1ffc..be0802ba 100644
|
|
--- a/repos/system_upgrade/common/actors/scancpu/tests/test_scancpu.py
|
|
+++ b/repos/system_upgrade/common/actors/scancpu/tests/test_scancpu.py
|
|
@@ -56,7 +56,7 @@ LSCPU = {
|
|
}
|
|
|
|
|
|
-class mocked_get_cpuinfo(object):
|
|
+class mocked_get_cpuinfo:
|
|
|
|
def __init__(self, filename):
|
|
self.filename = filename
|
|
diff --git a/repos/system_upgrade/common/actors/scancustomrepofile/tests/test_scancustomrepofile.py b/repos/system_upgrade/common/actors/scancustomrepofile/tests/test_scancustomrepofile.py
|
|
index 27dec8cc..772b33e6 100644
|
|
--- a/repos/system_upgrade/common/actors/scancustomrepofile/tests/test_scancustomrepofile.py
|
|
+++ b/repos/system_upgrade/common/actors/scancustomrepofile/tests/test_scancustomrepofile.py
|
|
@@ -23,7 +23,7 @@ _CUSTOM_REPOS = [
|
|
_CUSTOM_REPO_FILE_MSG = CustomTargetRepositoryFile(file=scancustomrepofile.CUSTOM_REPO_PATH)
|
|
|
|
|
|
-class LoggerMocked(object):
|
|
+class LoggerMocked:
|
|
def __init__(self):
|
|
self.infomsg = None
|
|
self.debugmsg = None
|
|
diff --git a/repos/system_upgrade/common/actors/scaninstalledtargetkernelversion/tests/test_scaninstalledkernel_scaninstalledtargetkernelversion.py b/repos/system_upgrade/common/actors/scaninstalledtargetkernelversion/tests/test_scaninstalledkernel_scaninstalledtargetkernelversion.py
|
|
index 570b6782..8f9f8b7a 100644
|
|
--- a/repos/system_upgrade/common/actors/scaninstalledtargetkernelversion/tests/test_scaninstalledkernel_scaninstalledtargetkernelversion.py
|
|
+++ b/repos/system_upgrade/common/actors/scaninstalledtargetkernelversion/tests/test_scaninstalledkernel_scaninstalledtargetkernelversion.py
|
|
@@ -15,7 +15,7 @@ OLD_KERNEL_NEVRA = 'kernel-core-0.1.2-3.el8.x86_64'
|
|
OLD_RT_KERNEL_NEVRA = 'kernel-rt-core-0.1.2-3.rt4.5.el8.x86_64'
|
|
|
|
|
|
-class MockedRun(object):
|
|
+class MockedRun:
|
|
|
|
def __init__(self, stdouts):
|
|
# stdouts should be dict of list of strings: { str: [str1,str2,...]}
|
|
diff --git a/repos/system_upgrade/common/actors/scansaphana/tests/test_scansaphana.py b/repos/system_upgrade/common/actors/scansaphana/tests/test_scansaphana.py
|
|
index 38a1cae7..791cdc68 100644
|
|
--- a/repos/system_upgrade/common/actors/scansaphana/tests/test_scansaphana.py
|
|
+++ b/repos/system_upgrade/common/actors/scansaphana/tests/test_scansaphana.py
|
|
@@ -59,7 +59,7 @@ compiler-version: GCC 9
|
|
lcmserver-artifact-version: 2.5.46'''))
|
|
|
|
|
|
-class CallMock(object):
|
|
+class CallMock:
|
|
def __init__(self, ret):
|
|
self.args = None
|
|
self.ret = ret
|
|
@@ -69,7 +69,7 @@ class CallMock(object):
|
|
return self.ret
|
|
|
|
|
|
-class SubprocessCall(object):
|
|
+class SubprocessCall:
|
|
def __init__(self, admusername):
|
|
self.admusername = admusername
|
|
|
|
@@ -108,7 +108,7 @@ def test_scansaphana_get_instance_status(monkeypatch):
|
|
|
|
|
|
def test_scansaphana_parse_manifest(monkeypatch):
|
|
- class _mock_open(object):
|
|
+ class _mock_open:
|
|
def __init__(self, path, mode):
|
|
self._fp = BytesIO(SAPHANA2_MANIFEST.encode('utf-8'))
|
|
|
|
diff --git a/repos/system_upgrade/common/actors/selinux/selinuxcontentscanner/tests/unit_test_selinuxcontentscanner.py b/repos/system_upgrade/common/actors/selinux/selinuxcontentscanner/tests/unit_test_selinuxcontentscanner.py
|
|
index 830eeac5..ce3ab7b5 100644
|
|
--- a/repos/system_upgrade/common/actors/selinux/selinuxcontentscanner/tests/unit_test_selinuxcontentscanner.py
|
|
+++ b/repos/system_upgrade/common/actors/selinux/selinuxcontentscanner/tests/unit_test_selinuxcontentscanner.py
|
|
@@ -3,7 +3,7 @@ from leapp.libraries.common.config import version
|
|
from leapp.libraries.stdlib import CalledProcessError
|
|
|
|
|
|
-class run_mocked(object):
|
|
+class run_mocked:
|
|
def __init__(self):
|
|
self.args = []
|
|
self.called = 0
|
|
@@ -39,7 +39,7 @@ class run_mocked(object):
|
|
return {'stdout': stdout}
|
|
|
|
|
|
-class run_mocked_fail(object):
|
|
+class run_mocked_fail:
|
|
def __init__(self):
|
|
self.called = 0
|
|
|
|
diff --git a/repos/system_upgrade/common/actors/selinux/selinuxprepare/tests/unit_test_selinuxprepare.py b/repos/system_upgrade/common/actors/selinux/selinuxprepare/tests/unit_test_selinuxprepare.py
|
|
index c1ad06c5..9b234d65 100644
|
|
--- a/repos/system_upgrade/common/actors/selinux/selinuxprepare/tests/unit_test_selinuxprepare.py
|
|
+++ b/repos/system_upgrade/common/actors/selinux/selinuxprepare/tests/unit_test_selinuxprepare.py
|
|
@@ -3,7 +3,7 @@ from leapp.libraries.stdlib import api, CalledProcessError, run
|
|
from leapp.models import SELinuxModule, SELinuxModules
|
|
|
|
|
|
-class run_mocked(object):
|
|
+class run_mocked:
|
|
def __init__(self):
|
|
self.args = []
|
|
self.called = 0
|
|
diff --git a/repos/system_upgrade/common/actors/setetcreleasever/tests/test_setetcreleasever.py b/repos/system_upgrade/common/actors/setetcreleasever/tests/test_setetcreleasever.py
|
|
index a14dd2b8..546ce195 100644
|
|
--- a/repos/system_upgrade/common/actors/setetcreleasever/tests/test_setetcreleasever.py
|
|
+++ b/repos/system_upgrade/common/actors/setetcreleasever/tests/test_setetcreleasever.py
|
|
@@ -16,7 +16,7 @@ from leapp.models import (
|
|
CUR_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
|
|
-class mocked_set_releasever(object):
|
|
+class mocked_set_releasever:
|
|
def __init__(self):
|
|
self.content = None
|
|
|
|
diff --git a/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos_repomap.py b/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos_repomap.py
|
|
index 343ee2ea..9613da9e 100644
|
|
--- a/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos_repomap.py
|
|
+++ b/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos_repomap.py
|
|
@@ -18,7 +18,7 @@ def _get_channel_prio(pesid_repo):
|
|
return priorities.get(pesid_repo.channel, 10)
|
|
|
|
|
|
-class RepoMapDataHandler(object):
|
|
+class RepoMapDataHandler:
|
|
"""
|
|
Provide the basic functionality to work with the repository data easily.
|
|
"""
|
|
diff --git a/repos/system_upgrade/common/actors/storagescanner/tests/unit_test_storagescanner.py b/repos/system_upgrade/common/actors/storagescanner/tests/unit_test_storagescanner.py
|
|
index 3c7fcbd6..6879e52a 100644
|
|
--- a/repos/system_upgrade/common/actors/storagescanner/tests/unit_test_storagescanner.py
|
|
+++ b/repos/system_upgrade/common/actors/storagescanner/tests/unit_test_storagescanner.py
|
|
@@ -459,7 +459,7 @@ def test_get_lvdisplay_info(monkeypatch):
|
|
|
|
def test_get_systemd_mount_info(monkeypatch):
|
|
|
|
- class UdevDeviceMocked(object):
|
|
+ class UdevDeviceMocked:
|
|
def __init__(self, device_node, path, model, wwn, fs_type, label, uuid):
|
|
self.device_node = device_node
|
|
# Simulate udev device attributes that should be queried
|
|
@@ -481,7 +481,7 @@ def test_get_systemd_mount_info(monkeypatch):
|
|
|
|
return self.device_attributes[attribute]
|
|
|
|
- class UdevContextMocked(object):
|
|
+ class UdevContextMocked:
|
|
def __init__(self, mocked_devices):
|
|
self.mocked_devices = mocked_devices
|
|
|
|
diff --git a/repos/system_upgrade/common/actors/systemd/checksystemdbrokensymlinks/tests/test_checksystemdbrokensymlinks.py b/repos/system_upgrade/common/actors/systemd/checksystemdbrokensymlinks/tests/test_checksystemdbrokensymlinks.py
|
|
index 2364f7a5..bcc33f13 100644
|
|
--- a/repos/system_upgrade/common/actors/systemd/checksystemdbrokensymlinks/tests/test_checksystemdbrokensymlinks.py
|
|
+++ b/repos/system_upgrade/common/actors/systemd/checksystemdbrokensymlinks/tests/test_checksystemdbrokensymlinks.py
|
|
@@ -38,7 +38,7 @@ def test_report_enabled_services_broken_symlinks(monkeypatch):
|
|
assert all([s in created_reports.report_fields['summary'] for s in symlinks])
|
|
|
|
|
|
-class ReportBrokenSymlinks(object):
|
|
+class ReportBrokenSymlinks:
|
|
def __init__(self):
|
|
self.symlinks = []
|
|
|
|
diff --git a/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/tests/test_repairsystemdsymlinks.py b/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/tests/test_repairsystemdsymlinks.py
|
|
index 2394df5e..5771fc6c 100644
|
|
--- a/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/tests/test_repairsystemdsymlinks.py
|
|
+++ b/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/tests/test_repairsystemdsymlinks.py
|
|
@@ -10,7 +10,7 @@ from leapp.models import (
|
|
)
|
|
|
|
|
|
-class MockedSystemdCmd(object):
|
|
+class MockedSystemdCmd:
|
|
def __init__(self):
|
|
self.units = []
|
|
|
|
diff --git a/repos/system_upgrade/common/actors/systemd/scansystemdsource/tests/test_scansystemdsource.py b/repos/system_upgrade/common/actors/systemd/scansystemdsource/tests/test_scansystemdsource.py
|
|
index 7b95a2df..f92657d3 100644
|
|
--- a/repos/system_upgrade/common/actors/systemd/scansystemdsource/tests/test_scansystemdsource.py
|
|
+++ b/repos/system_upgrade/common/actors/systemd/scansystemdsource/tests/test_scansystemdsource.py
|
|
@@ -73,7 +73,7 @@ _CALL_PROC_ERR = CalledProcessError(
|
|
)
|
|
|
|
|
|
-class GetOrRaise(object):
|
|
+class GetOrRaise:
|
|
def __init__(self, value):
|
|
self.value = value
|
|
|
|
diff --git a/repos/system_upgrade/common/actors/systemd/scansystemdtarget/tests/test_scansystemdtarget.py b/repos/system_upgrade/common/actors/systemd/scansystemdtarget/tests/test_scansystemdtarget.py
|
|
index 227ba61a..2e806e25 100644
|
|
--- a/repos/system_upgrade/common/actors/systemd/scansystemdtarget/tests/test_scansystemdtarget.py
|
|
+++ b/repos/system_upgrade/common/actors/systemd/scansystemdtarget/tests/test_scansystemdtarget.py
|
|
@@ -73,7 +73,7 @@ _CALL_PROC_ERR = CalledProcessError(
|
|
)
|
|
|
|
|
|
-class GetOrRaise(object):
|
|
+class GetOrRaise:
|
|
def __init__(self, value):
|
|
self.value = value
|
|
|
|
diff --git a/repos/system_upgrade/common/actors/systemd/setsystemdservicesstates/tests/test_setsystemdservicesstate.py b/repos/system_upgrade/common/actors/systemd/setsystemdservicesstates/tests/test_setsystemdservicesstate.py
|
|
index fa17a94c..976da6da 100644
|
|
--- a/repos/system_upgrade/common/actors/systemd/setsystemdservicesstates/tests/test_setsystemdservicesstate.py
|
|
+++ b/repos/system_upgrade/common/actors/systemd/setsystemdservicesstates/tests/test_setsystemdservicesstate.py
|
|
@@ -8,7 +8,7 @@ from leapp.libraries.stdlib import api, CalledProcessError
|
|
from leapp.models import SystemdServicesTasks
|
|
|
|
|
|
-class MockedSystemdCmd(object):
|
|
+class MockedSystemdCmd:
|
|
def __init__(self):
|
|
self.units = []
|
|
|
|
diff --git a/repos/system_upgrade/common/actors/systemfacts/tests/test_systemfacts.py b/repos/system_upgrade/common/actors/systemfacts/tests/test_systemfacts.py
|
|
index 5831b979..16405b15 100644
|
|
--- a/repos/system_upgrade/common/actors/systemfacts/tests/test_systemfacts.py
|
|
+++ b/repos/system_upgrade/common/actors/systemfacts/tests/test_systemfacts.py
|
|
@@ -61,7 +61,7 @@ def test_aslist(current_actor_libraries):
|
|
)
|
|
def test_get_system_users(monkeypatch, etc_passwd_names, etc_passwd_directory, skipped_user_names):
|
|
|
|
- class MockedPwdEntry(object):
|
|
+ class MockedPwdEntry:
|
|
def __init__(self, pw_name, pw_uid, pw_gid, pw_dir):
|
|
self.pw_name = pw_name
|
|
self.pw_uid = pw_uid
|
|
@@ -99,7 +99,7 @@ def test_get_system_users(monkeypatch, etc_passwd_names, etc_passwd_directory, s
|
|
)
|
|
def test_get_system_groups(monkeypatch, etc_group_names, skipped_group_names):
|
|
|
|
- class MockedGrpEntry(object):
|
|
+ class MockedGrpEntry:
|
|
def __init__(self, gr_name, gr_gid, gr_mem):
|
|
self.gr_name = gr_name
|
|
self.gr_gid = gr_gid
|
|
diff --git a/repos/system_upgrade/common/actors/systemfacts/tests/test_systemfacts_grub.py b/repos/system_upgrade/common/actors/systemfacts/tests/test_systemfacts_grub.py
|
|
index 08552771..7fd774b5 100644
|
|
--- a/repos/system_upgrade/common/actors/systemfacts/tests/test_systemfacts_grub.py
|
|
+++ b/repos/system_upgrade/common/actors/systemfacts/tests/test_systemfacts_grub.py
|
|
@@ -4,7 +4,7 @@ from leapp.libraries.actor import systemfacts
|
|
from leapp.models import DefaultGrub
|
|
|
|
|
|
-class RunMocked(object):
|
|
+class RunMocked:
|
|
def __init__(self, cmd_result):
|
|
self.called = 0
|
|
self.cmd_result = cmd_result
|
|
diff --git a/repos/system_upgrade/common/actors/systemfacts/tests/test_systemfacts_selinux.py b/repos/system_upgrade/common/actors/systemfacts/tests/test_systemfacts_selinux.py
|
|
index b9e0c71d..d36900bd 100644
|
|
--- a/repos/system_upgrade/common/actors/systemfacts/tests/test_systemfacts_selinux.py
|
|
+++ b/repos/system_upgrade/common/actors/systemfacts/tests/test_systemfacts_selinux.py
|
|
@@ -74,7 +74,7 @@ def test_selinux_disabled(monkeypatch):
|
|
assert SELinuxFacts(**expected_data) == get_selinux_status()
|
|
|
|
|
|
-class MockNoConfigFileOSError(object):
|
|
+class MockNoConfigFileOSError:
|
|
def __init__(self):
|
|
raise OSError
|
|
|
|
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
|
index 26fec2d9..899d72f7 100644
|
|
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
|
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
|
@@ -79,7 +79,7 @@ class BrokenSymlinkError(Exception):
|
|
"""Raised when we encounter a broken symlink where we weren't expecting it."""
|
|
|
|
|
|
-class _InputData(object):
|
|
+class _InputData:
|
|
def __init__(self):
|
|
self._consume_data()
|
|
|
|
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
|
index e78c3ac7..1e5b87b0 100644
|
|
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
|
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
|
@@ -36,7 +36,7 @@ def adjust_cwd():
|
|
os.chdir(previous_cwd)
|
|
|
|
|
|
-class MockedMountingBase(object):
|
|
+class MockedMountingBase:
|
|
def __init__(self, **dummy_kwargs):
|
|
self.called_copytree_from = []
|
|
self.target = ''
|
|
@@ -923,7 +923,7 @@ _SAEE = StopActorExecutionError
|
|
_SAE = StopActorExecution
|
|
|
|
|
|
-class MockedConsume(object):
|
|
+class MockedConsume:
|
|
def __init__(self, *args):
|
|
self._msgs = []
|
|
for arg in args:
|
|
diff --git a/repos/system_upgrade/common/actors/trustedgpgkeysscanner/tests/test_trustedgpgkeys.py b/repos/system_upgrade/common/actors/trustedgpgkeysscanner/tests/test_trustedgpgkeys.py
|
|
index 0d98aad7..7497c2a9 100644
|
|
--- a/repos/system_upgrade/common/actors/trustedgpgkeysscanner/tests/test_trustedgpgkeys.py
|
|
+++ b/repos/system_upgrade/common/actors/trustedgpgkeysscanner/tests/test_trustedgpgkeys.py
|
|
@@ -32,7 +32,7 @@ def _get_test_installed_rmps(fps):
|
|
return InstalledRPM(items=rpms)
|
|
|
|
|
|
-class MockedGetGpgFromFile(object):
|
|
+class MockedGetGpgFromFile:
|
|
def __init__(self, file_fps_tuples):
|
|
# e.g. file_fps_tuple = [('/mydir/myfile', ['0000ff31', '0000ff32'])]
|
|
self._data = {}
|
|
diff --git a/repos/system_upgrade/common/actors/updategrubcore/tests/test_updategrubcore.py b/repos/system_upgrade/common/actors/updategrubcore/tests/test_updategrubcore.py
|
|
index 27a4a245..93816103 100644
|
|
--- a/repos/system_upgrade/common/actors/updategrubcore/tests/test_updategrubcore.py
|
|
+++ b/repos/system_upgrade/common/actors/updategrubcore/tests/test_updategrubcore.py
|
|
@@ -20,7 +20,7 @@ def raise_call_error(args=None):
|
|
)
|
|
|
|
|
|
-class run_mocked(object):
|
|
+class run_mocked:
|
|
def __init__(self, raise_err=False, raise_callback=raise_call_error):
|
|
self.called = 0
|
|
self.args = []
|
|
diff --git a/repos/system_upgrade/common/actors/verifycheckresults/tests/unit_test_verifycheckresults.py b/repos/system_upgrade/common/actors/verifycheckresults/tests/unit_test_verifycheckresults.py
|
|
index 6f459a69..6df9ff20 100644
|
|
--- a/repos/system_upgrade/common/actors/verifycheckresults/tests/unit_test_verifycheckresults.py
|
|
+++ b/repos/system_upgrade/common/actors/verifycheckresults/tests/unit_test_verifycheckresults.py
|
|
@@ -7,7 +7,7 @@ from leapp.libraries.actor import verifycheckresults
|
|
from leapp.libraries.stdlib import api
|
|
|
|
|
|
-class Report(object):
|
|
+class Report:
|
|
def __init__(self, message):
|
|
self.message = message
|
|
|
|
diff --git a/repos/system_upgrade/common/actors/xfsinfoscanner/tests/unit_test_xfsinfoscanner.py b/repos/system_upgrade/common/actors/xfsinfoscanner/tests/unit_test_xfsinfoscanner.py
|
|
index 71f46b47..34e542a8 100644
|
|
--- a/repos/system_upgrade/common/actors/xfsinfoscanner/tests/unit_test_xfsinfoscanner.py
|
|
+++ b/repos/system_upgrade/common/actors/xfsinfoscanner/tests/unit_test_xfsinfoscanner.py
|
|
@@ -146,7 +146,7 @@ TEST_XFS_INFO_FTYPE0_MODEL = XFSInfo(
|
|
)
|
|
|
|
|
|
-class run_mocked(object):
|
|
+class run_mocked:
|
|
def __init__(self):
|
|
self.called = 0
|
|
self.args = None
|
|
diff --git a/repos/system_upgrade/common/libraries/grub.py b/repos/system_upgrade/common/libraries/grub.py
|
|
index cd960ea4..71432371 100644
|
|
--- a/repos/system_upgrade/common/libraries/grub.py
|
|
+++ b/repos/system_upgrade/common/libraries/grub.py
|
|
@@ -30,7 +30,7 @@ def canonical_path_to_efi_format(canonical_path):
|
|
return canonical_path.replace(EFI_MOUNTPOINT[:-1], "").replace("/", "\\")
|
|
|
|
|
|
-class EFIBootLoaderEntry(object):
|
|
+class EFIBootLoaderEntry:
|
|
"""
|
|
Representation of an UEFI boot loader entry.
|
|
"""
|
|
@@ -102,7 +102,7 @@ class EFIBootLoaderEntry(object):
|
|
return EFIBootLoaderEntry._efi_path_to_canonical(match.groups('path')[0])
|
|
|
|
|
|
-class EFIBootInfo(object):
|
|
+class EFIBootInfo:
|
|
"""
|
|
Data about the current UEFI boot configuration.
|
|
|
|
diff --git a/repos/system_upgrade/common/libraries/kernel.py b/repos/system_upgrade/common/libraries/kernel.py
|
|
index dac21b06..fc8c1167 100644
|
|
--- a/repos/system_upgrade/common/libraries/kernel.py
|
|
+++ b/repos/system_upgrade/common/libraries/kernel.py
|
|
@@ -9,7 +9,7 @@ KernelPkgInfo = namedtuple('KernelPkgInfo', ('name', 'version', 'release', 'arch
|
|
KERNEL_UNAME_R_PROVIDES = ['kernel-uname-r', 'kernel-rt-uname-r']
|
|
|
|
|
|
-class KernelType(object):
|
|
+class KernelType:
|
|
ORDINARY = 'ordinary'
|
|
REALTIME = 'realtime'
|
|
|
|
diff --git a/repos/system_upgrade/common/libraries/mounting.py b/repos/system_upgrade/common/libraries/mounting.py
|
|
index 2eb19d31..4e99e31e 100644
|
|
--- a/repos/system_upgrade/common/libraries/mounting.py
|
|
+++ b/repos/system_upgrade/common/libraries/mounting.py
|
|
@@ -16,7 +16,7 @@ ALWAYS_BIND = []
|
|
ErrorData = namedtuple('ErrorData', ['summary', 'details'])
|
|
|
|
|
|
-class MountingMode(object):
|
|
+class MountingMode:
|
|
"""
|
|
MountingMode are types of mounts supported by the library
|
|
"""
|
|
@@ -50,9 +50,9 @@ class MountError(Exception):
|
|
self.details = details
|
|
|
|
|
|
-class IsolationType(object):
|
|
+class IsolationType:
|
|
""" Implementations for the different isolated actions types """
|
|
- class _Implementation(object):
|
|
+ class _Implementation:
|
|
""" Base class for all isolated actions """
|
|
|
|
def __init__(self, target, **kwargs):
|
|
@@ -129,7 +129,7 @@ class IsolationType(object):
|
|
""" Execute the given commands and perform the given operations on the real system and not isolated. """
|
|
|
|
|
|
-class IsolatedActions(object):
|
|
+class IsolatedActions:
|
|
""" This class allows to perform actions in a manner as if the given base_dir would be the current root """
|
|
|
|
_isolated = True
|
|
@@ -280,7 +280,7 @@ class NotIsolatedActions(IsolatedActions):
|
|
super(NotIsolatedActions, self).__init__(base_dir=base_dir, implementation=IsolationType.NONE)
|
|
|
|
|
|
-class MountConfig(object):
|
|
+class MountConfig:
|
|
""" Options for Mount """
|
|
_Options = namedtuple('_Options', ('should_create', 'should_cleanup'))
|
|
AttachOnly = _Options(should_create=False, should_cleanup=False)
|
|
@@ -293,7 +293,7 @@ class MountConfig(object):
|
|
""" Create all necessary directories and perform mount calls and cleanup afterwards """
|
|
|
|
|
|
-class MountingBase(object):
|
|
+class MountingBase:
|
|
""" Base class for all mount operations """
|
|
|
|
def __init__(self, source, target, mode, config=MountConfig.Mount):
|
|
diff --git a/repos/system_upgrade/common/libraries/multipathutil.py b/repos/system_upgrade/common/libraries/multipathutil.py
|
|
index 47d0d86e..cb5c3693 100644
|
|
--- a/repos/system_upgrade/common/libraries/multipathutil.py
|
|
+++ b/repos/system_upgrade/common/libraries/multipathutil.py
|
|
@@ -38,7 +38,7 @@ def write_config(path, contents):
|
|
)
|
|
|
|
|
|
-class LineData(object):
|
|
+class LineData:
|
|
TYPE_BLANK = 0
|
|
TYPE_SECTION_START = 1
|
|
TYPE_SECTION_END = 2
|
|
diff --git a/repos/system_upgrade/common/libraries/rhui.py b/repos/system_upgrade/common/libraries/rhui.py
|
|
index 5c293304..c90c8c14 100644
|
|
--- a/repos/system_upgrade/common/libraries/rhui.py
|
|
+++ b/repos/system_upgrade/common/libraries/rhui.py
|
|
@@ -21,7 +21,7 @@ RHUI_PKI_PRIVATE_DIR = os.path.join(RHUI_PKI_DIR, 'private')
|
|
AWS_DNF_PLUGIN_NAME = 'amazon-id.py'
|
|
|
|
|
|
-class ContentChannel(object):
|
|
+class ContentChannel:
|
|
GA = 'ga'
|
|
TUV = 'tuv'
|
|
E4S = 'e4s'
|
|
@@ -30,14 +30,14 @@ class ContentChannel(object):
|
|
BETA = 'beta'
|
|
|
|
|
|
-class RHUIVariant(object):
|
|
+class RHUIVariant:
|
|
ORDINARY = 'ordinary' # Special value - not displayed in report/errors
|
|
SAP = 'sap'
|
|
SAP_APPS = 'sap-apps'
|
|
SAP_HA = 'sap-ha'
|
|
|
|
|
|
-class RHUIProvider(object):
|
|
+class RHUIProvider:
|
|
GOOGLE = 'Google'
|
|
AZURE = 'Azure'
|
|
AWS = 'AWS'
|
|
@@ -74,7 +74,7 @@ RHUISetup = namedtuple(
|
|
"""
|
|
|
|
|
|
-class RHUIFamily(object):
|
|
+class RHUIFamily:
|
|
def __init__(self, provider, client_files_folder='', variant=RHUIVariant.ORDINARY, arch=arch.ARCH_X86_64,):
|
|
self.provider = provider
|
|
self.client_files_folder = client_files_folder
|
|
diff --git a/repos/system_upgrade/common/libraries/rpms.py b/repos/system_upgrade/common/libraries/rpms.py
|
|
index bd3a2961..8f98c1a4 100644
|
|
--- a/repos/system_upgrade/common/libraries/rpms.py
|
|
+++ b/repos/system_upgrade/common/libraries/rpms.py
|
|
@@ -3,7 +3,7 @@ from leapp.libraries.common.config.version import get_source_major_version
|
|
from leapp.models import InstalledRPM
|
|
|
|
|
|
-class LeappComponents(object):
|
|
+class LeappComponents:
|
|
"""
|
|
Supported component values to be used with get_packages_function:
|
|
* FRAMEWORK - the core of the leapp project: the leapp executable and
|
|
diff --git a/repos/system_upgrade/common/libraries/tests/test_grub.py b/repos/system_upgrade/common/libraries/tests/test_grub.py
|
|
index 9bc9f682..d6f428bb 100644
|
|
--- a/repos/system_upgrade/common/libraries/tests/test_grub.py
|
|
+++ b/repos/system_upgrade/common/libraries/tests/test_grub.py
|
|
@@ -98,7 +98,7 @@ def raise_call_error(args=None):
|
|
)
|
|
|
|
|
|
-class RunMocked(object):
|
|
+class RunMocked:
|
|
|
|
def __init__(self, raise_err=False, boot_on_raid=False):
|
|
self.called = 0
|
|
diff --git a/repos/system_upgrade/common/libraries/tests/test_mdraid.py b/repos/system_upgrade/common/libraries/tests/test_mdraid.py
|
|
index d536beec..8668be8c 100644
|
|
--- a/repos/system_upgrade/common/libraries/tests/test_mdraid.py
|
|
+++ b/repos/system_upgrade/common/libraries/tests/test_mdraid.py
|
|
@@ -20,7 +20,7 @@ def raise_call_error(args=None):
|
|
)
|
|
|
|
|
|
-class RunMocked(object):
|
|
+class RunMocked:
|
|
|
|
def __init__(self, raise_err=False):
|
|
self.called = 0
|
|
diff --git a/repos/system_upgrade/common/libraries/tests/test_persistentnetnames_library.py b/repos/system_upgrade/common/libraries/tests/test_persistentnetnames_library.py
|
|
index 2c399888..74aa08fa 100644
|
|
--- a/repos/system_upgrade/common/libraries/tests/test_persistentnetnames_library.py
|
|
+++ b/repos/system_upgrade/common/libraries/tests/test_persistentnetnames_library.py
|
|
@@ -3,7 +3,7 @@ from leapp.libraries.common.testutils import produce_mocked
|
|
from leapp.libraries.stdlib import api
|
|
|
|
|
|
-class AttributesTest(object):
|
|
+class AttributesTest:
|
|
def __init__(self):
|
|
self.attributes = {
|
|
'address': b'fa:16:3e:cd:26:5a'
|
|
@@ -15,7 +15,7 @@ class AttributesTest(object):
|
|
raise KeyError
|
|
|
|
|
|
-class DeviceTest(object):
|
|
+class DeviceTest:
|
|
def __init__(self):
|
|
self.dict_data = {
|
|
'ID_NET_DRIVER': 'virtio_net',
|
|
diff --git a/repos/system_upgrade/common/libraries/tests/test_rhsm.py b/repos/system_upgrade/common/libraries/tests/test_rhsm.py
|
|
index b643cd0d..84a1bd5e 100644
|
|
--- a/repos/system_upgrade/common/libraries/tests/test_rhsm.py
|
|
+++ b/repos/system_upgrade/common/libraries/tests/test_rhsm.py
|
|
@@ -62,7 +62,7 @@ RHSM_ENABLED_REPOS = [
|
|
]
|
|
|
|
|
|
-class IsolatedActionsMocked(object):
|
|
+class IsolatedActionsMocked:
|
|
def __init__(self, call_stdout=None, raise_err=False):
|
|
self.commands_called = []
|
|
self.call_return = {'stdout': call_stdout, 'stderr': None}
|
|
diff --git a/repos/system_upgrade/common/libraries/testutils.py b/repos/system_upgrade/common/libraries/testutils.py
|
|
index 3e145d91..328a7ede 100644
|
|
--- a/repos/system_upgrade/common/libraries/testutils.py
|
|
+++ b/repos/system_upgrade/common/libraries/testutils.py
|
|
@@ -10,7 +10,7 @@ from leapp.models import EnvVar, IPUSourceToPossibleTargets
|
|
from leapp.utils.deprecation import deprecated
|
|
|
|
|
|
-class produce_mocked(object):
|
|
+class produce_mocked:
|
|
def __init__(self):
|
|
self.called = 0
|
|
self.model_instances = []
|
|
@@ -20,7 +20,7 @@ class produce_mocked(object):
|
|
self.model_instances.extend(list(model_instances))
|
|
|
|
|
|
-class create_report_mocked(object):
|
|
+class create_report_mocked:
|
|
def __init__(self):
|
|
self.called = 0
|
|
self.reports = []
|
|
@@ -38,7 +38,7 @@ class create_report_mocked(object):
|
|
return {}
|
|
|
|
|
|
-class logger_mocked(object):
|
|
+class logger_mocked:
|
|
def __init__(self):
|
|
self.dbgmsg = []
|
|
self.infomsg = []
|
|
@@ -77,7 +77,7 @@ def _make_default_config(actor_config_schema):
|
|
# Note: The constructor of the following class takes in too many arguments (R0913). A builder-like
|
|
# pattern would be nice here. Ideally, the builder should actively prevent the developer from setting fields
|
|
# that do not affect actor's behavior in __setattr__.
|
|
-class CurrentActorMocked(object): # pylint:disable=R0904
|
|
+class CurrentActorMocked: # pylint:disable=R0904
|
|
def __init__(self, arch=architecture.ARCH_X86_64, envars=None, # pylint:disable=R0913
|
|
kernel='3.10.0-957.43.1.el7.x86_64',
|
|
release_id='rhel', src_ver='7.8', dst_ver='8.1', msgs=None, flavour='default', config=None,
|
|
diff --git a/repos/system_upgrade/el8toel9/actors/addarmbootloaderworkaround/tests/test_addarmbootloaderworkaround.py b/repos/system_upgrade/el8toel9/actors/addarmbootloaderworkaround/tests/test_addarmbootloaderworkaround.py
|
|
index 4f990e00..8c41cc7b 100644
|
|
--- a/repos/system_upgrade/el8toel9/actors/addarmbootloaderworkaround/tests/test_addarmbootloaderworkaround.py
|
|
+++ b/repos/system_upgrade/el8toel9/actors/addarmbootloaderworkaround/tests/test_addarmbootloaderworkaround.py
|
|
@@ -35,7 +35,7 @@ class MockEFIBootInfo:
|
|
}
|
|
|
|
|
|
-class IsolatedActionsMocked(object):
|
|
+class IsolatedActionsMocked:
|
|
def __init__(self):
|
|
self.copytree_from_calls = []
|
|
|
|
diff --git a/repos/system_upgrade/el8toel9/actors/cloud/ensurevalidgrubcfghybrid/tests/test_ensurevalidgrubcfghybrid.py b/repos/system_upgrade/el8toel9/actors/cloud/ensurevalidgrubcfghybrid/tests/test_ensurevalidgrubcfghybrid.py
|
|
index 3ba46cb5..72356172 100644
|
|
--- a/repos/system_upgrade/el8toel9/actors/cloud/ensurevalidgrubcfghybrid/tests/test_ensurevalidgrubcfghybrid.py
|
|
+++ b/repos/system_upgrade/el8toel9/actors/cloud/ensurevalidgrubcfghybrid/tests/test_ensurevalidgrubcfghybrid.py
|
|
@@ -19,7 +19,7 @@ def raise_call_error(args=None):
|
|
)
|
|
|
|
|
|
-class run_mocked(object):
|
|
+class run_mocked:
|
|
def __init__(self, raise_err=False):
|
|
self.called = 0
|
|
self.args = []
|
|
diff --git a/repos/system_upgrade/el8toel9/actors/grub2mkconfigonppc64/tests/test_grub2mkconfigonppc64.py b/repos/system_upgrade/el8toel9/actors/grub2mkconfigonppc64/tests/test_grub2mkconfigonppc64.py
|
|
index afa999d0..9d5da4b2 100644
|
|
--- a/repos/system_upgrade/el8toel9/actors/grub2mkconfigonppc64/tests/test_grub2mkconfigonppc64.py
|
|
+++ b/repos/system_upgrade/el8toel9/actors/grub2mkconfigonppc64/tests/test_grub2mkconfigonppc64.py
|
|
@@ -12,7 +12,7 @@ from leapp.models import DefaultGrub, DefaultGrubInfo, FirmwareFacts
|
|
CUR_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
|
|
-class MockedRun(object):
|
|
+class MockedRun:
|
|
def __init__(self):
|
|
self.commands = []
|
|
|
|
@@ -36,7 +36,7 @@ def test_run_grub2mkconfig(monkeypatch, cmd_issued):
|
|
'menuentry "Red Hat Enterprise Linux Server (3.10.0-1160.45.1.el7.x86_64) 7.9 (Maipo)"'
|
|
)
|
|
|
|
- class _mock_open(object):
|
|
+ class _mock_open:
|
|
def __init__(self, path, mode):
|
|
input_ = grub2_cfg_non_bls_excerpt if cmd_issued else grub2_cfg_bls_excerpt
|
|
self._fp = StringIO(input_)
|
|
diff --git a/repos/system_upgrade/el8toel9/actors/opensshdropindirectory/tests/test_opensshdropindirectory_prepend.py b/repos/system_upgrade/el8toel9/actors/opensshdropindirectory/tests/test_opensshdropindirectory_prepend.py
|
|
index bccadf4b..a6665313 100644
|
|
--- a/repos/system_upgrade/el8toel9/actors/opensshdropindirectory/tests/test_opensshdropindirectory_prepend.py
|
|
+++ b/repos/system_upgrade/el8toel9/actors/opensshdropindirectory/tests/test_opensshdropindirectory_prepend.py
|
|
@@ -3,7 +3,7 @@ import pytest
|
|
from leapp.libraries.actor.opensshdropindirectory import prepend_string_if_not_present
|
|
|
|
|
|
-class MockFile(object):
|
|
+class MockFile:
|
|
def __init__(self, path, content=None):
|
|
self.path = path
|
|
self.content = content
|
|
diff --git a/repos/system_upgrade/el8toel9/actors/opensslproviders/tests/test_add_provider.py b/repos/system_upgrade/el8toel9/actors/opensslproviders/tests/test_add_provider.py
|
|
index 1c1cd209..78f2e9c6 100644
|
|
--- a/repos/system_upgrade/el8toel9/actors/opensslproviders/tests/test_add_provider.py
|
|
+++ b/repos/system_upgrade/el8toel9/actors/opensslproviders/tests/test_add_provider.py
|
|
@@ -64,7 +64,7 @@ def test_append(lines, add, comment, expected):
|
|
assert r == expected
|
|
|
|
|
|
-class MockFile(object):
|
|
+class MockFile:
|
|
def __init__(self, content=None):
|
|
self.content = content
|
|
self.error = False
|
|
diff --git a/repos/system_upgrade/el8toel9/actors/scanblacklistca/tests/unit_test_scanblacklistca.py b/repos/system_upgrade/el8toel9/actors/scanblacklistca/tests/unit_test_scanblacklistca.py
|
|
index 4eab6df5..c2ae4639 100644
|
|
--- a/repos/system_upgrade/el8toel9/actors/scanblacklistca/tests/unit_test_scanblacklistca.py
|
|
+++ b/repos/system_upgrade/el8toel9/actors/scanblacklistca/tests/unit_test_scanblacklistca.py
|
|
@@ -14,7 +14,7 @@ TESTLINK = "linkca.cert"
|
|
SUBDIR = "casdir"
|
|
|
|
|
|
-class MockedGetFiles(object):
|
|
+class MockedGetFiles:
|
|
def __init__(self, files=None, error=None):
|
|
self.called = 0
|
|
self.files = files
|
|
@@ -33,7 +33,7 @@ class MockedGetFiles(object):
|
|
return ret
|
|
|
|
|
|
-class MockedGetDirs(object):
|
|
+class MockedGetDirs:
|
|
def __init__(self, dirs):
|
|
self.called = 0
|
|
self.dirs = dirs
|
|
diff --git a/repos/system_upgrade/el8toel9/actors/sssdfacts/libraries/sssdfacts8to9.py b/repos/system_upgrade/el8toel9/actors/sssdfacts/libraries/sssdfacts8to9.py
|
|
index a2537eeb..1482373e 100644
|
|
--- a/repos/system_upgrade/el8toel9/actors/sssdfacts/libraries/sssdfacts8to9.py
|
|
+++ b/repos/system_upgrade/el8toel9/actors/sssdfacts/libraries/sssdfacts8to9.py
|
|
@@ -1,7 +1,7 @@
|
|
from leapp.models import SSSDConfig8to9
|
|
|
|
|
|
-class SSSDFactsLibrary(object):
|
|
+class SSSDFactsLibrary:
|
|
"""
|
|
Helper library from SSSDFacts actor to allow unit testing.
|
|
"""
|
|
--
|
|
2.51.1
|
|
|