Skip to content

Commit

Permalink
Fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
poncovka committed Jan 12, 2023
1 parent a82595a commit 36f73f7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dracut/parse-kickstart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ from pykickstart.commands.mediacheck import FC4_MediaCheck as MediaCheck
from pykickstart.commands.driverdisk import F14_DriverDisk as DriverDisk
from pykickstart.commands.network import F27_Network as Network
from pykickstart.commands.displaymode import F26_DisplayMode as DisplayMode
from pykickstart.commands.bootloader import F34_Bootloader as Bootloader
from pykickstart.commands.bootloader import F38_Bootloader as Bootloader

# Default logging: none
log = logging.getLogger('parse-kickstart').addHandler(logging.NullHandler())
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/modules/storage/bootloader/bootloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,10 +509,10 @@ def generate_initramfs_with_tasks(self, payload_type, kernel_versions):
"""
return [
RecreateInitrdsTask(
storage=self.storage,
payload_type=payload_type,
kernel_versions=kernel_versions,
sysroot=conf.target.system_root,
storage=self.storage
),
FixBTRFSBootloaderTask(
storage=self.storage,
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/modules/storage/bootloader/installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def run(self):
class RecreateInitrdsTask(Task):
"""Installation task that recreates the initrds."""

def __init__(self, payload_type, kernel_versions, sysroot, storage):
def __init__(self, storage, payload_type, kernel_versions, sysroot):
"""Create a new task."""
super().__init__()
self._storage = storage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,12 @@ def test_create_bls_entries(self, exec_mock):
@patch('pyanaconda.modules.storage.bootloader.utils.conf')
def test_recreate_initrds(self, conf_mock, exec_mock):
"""Test the installation task that recreates initrds."""
storage = Mock(bootloader=EFIGRUB())
version = "4.17.7-200.fc28.x86_64"

with tempfile.TemporaryDirectory() as root:
task = RecreateInitrdsTask(
storage=storage,
sysroot=root,
payload_type=PAYLOAD_TYPE_RPM_OSTREE,
kernel_versions=[version]
Expand All @@ -499,6 +501,7 @@ def test_recreate_initrds(self, conf_mock, exec_mock):

with tempfile.TemporaryDirectory() as root:
task = RecreateInitrdsTask(
storage=storage,
sysroot=root,
payload_type=PAYLOAD_TYPE_LIVE_IMAGE,
kernel_versions=[version]
Expand Down Expand Up @@ -526,6 +529,7 @@ def test_recreate_initrds(self, conf_mock, exec_mock):
open(root + "/usr/sbin/new-kernel-pkg", 'wb').close()

task = RecreateInitrdsTask(
storage=storage,
sysroot=root,
payload_type=PAYLOAD_TYPE_LIVE_IMAGE,
kernel_versions=[version]
Expand All @@ -546,6 +550,7 @@ def test_recreate_initrds(self, conf_mock, exec_mock):

with tempfile.TemporaryDirectory() as root:
task = RecreateInitrdsTask(
storage=storage,
sysroot=root,
payload_type=PAYLOAD_TYPE_LIVE_IMAGE,
kernel_versions=[version]
Expand Down

0 comments on commit 36f73f7

Please sign in to comment.