Skip to content

Commit

Permalink
Cast to type and prevent Any
Browse files Browse the repository at this point in the history
  • Loading branch information
schaefi committed Jan 12, 2024
1 parent b30594a commit 146fa5e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions kiwi/builder/disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import os
import logging
from typing import (
Dict, List, Optional, Tuple, Any
Dict, List, Optional, Tuple, Any, cast
)

# project
Expand Down Expand Up @@ -49,6 +49,7 @@
from kiwi.filesystem import FileSystem
from kiwi.filesystem.squashfs import FileSystemSquashFs
from kiwi.volume_manager import VolumeManager
from kiwi.volume_manager.base import VolumeManagerBase
from kiwi.command import Command
from kiwi.system.setup import SystemSetup
from kiwi.builder.install import InstallImageBuilder
Expand Down Expand Up @@ -644,7 +645,7 @@ def _build_main_system(
self,
device_map: Dict,
disk: Disk,
system: Any,
system: FileSystemBase | VolumeManagerBase,
system_boot: Optional[FileSystemBase],
system_efi: Optional[FileSystemBase],
system_spare: Optional[FileSystemBase],
Expand Down Expand Up @@ -738,7 +739,7 @@ def _build_main_system(
):
image_system = ImageSystem(
device_map, self.root_dir,
system.get_volumes() if self.volume_manager_name else {}
cast(VolumeManagerBase, system).get_volumes() if self.volume_manager_name else {}
)
image_system.mount()
disk_system = SystemSetup(
Expand Down

0 comments on commit 146fa5e

Please sign in to comment.