Skip to content

Commit

Permalink
Convert Device to use pydantic
Browse files Browse the repository at this point in the history
Signed-off-by: mulhern <amulhern@redhat.com>
  • Loading branch information
mulkieran committed May 29, 2024
1 parent a0a110e commit f24d6dd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/stratis_cli/_actions/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,13 @@ def __init__(self, info):
self.value = str(value)


class Device: # pylint: disable=too-few-public-methods
class Device(BaseModel):
"""
A representation of a device in a stopped pool.
"""

def __init__(self, mapping):
self.uuid = UUID(mapping["uuid"])
self.devnode = str(mapping["devnode"])
uuid: UUID
devnode: str


class StoppedPool(BaseModel):
Expand Down

0 comments on commit f24d6dd

Please sign in to comment.