Fix 2304 (#3503)
This commit is contained in:
parent
cdb1debe2e
commit
6d1a450440
|
|
@ -6,6 +6,7 @@ from dataclasses import dataclass, field
|
|||
from enum import Enum
|
||||
from pathlib import Path
|
||||
from typing import NotRequired, TypedDict, override
|
||||
from uuid import UUID
|
||||
|
||||
import parted
|
||||
from parted import Disk, Geometry, Partition
|
||||
|
|
@ -884,6 +885,8 @@ class PartitionModification:
|
|||
partuuid: str | None = None
|
||||
uuid: str | None = None
|
||||
|
||||
_obj_id: UUID | str = field(init=False)
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
# needed to use the object as a dictionary key due to hash func
|
||||
if not hasattr(self, '_obj_id'):
|
||||
|
|
@ -1147,6 +1150,8 @@ class LvmVolume:
|
|||
# mapper device path /dev/<vg>/<vol>
|
||||
dev_path: Path | None = None
|
||||
|
||||
_obj_id: uuid.UUID | str = field(init=False)
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
# needed to use the object as a dictionary key due to hash func
|
||||
if not hasattr(self, '_obj_id'):
|
||||
|
|
|
|||
Loading…
Reference in New Issue