Skip to content

Commit f24d6dd

Browse files
committed
Convert Device to use pydantic
Signed-off-by: mulhern <[email protected]>
1 parent a0a110e commit f24d6dd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/stratis_cli/_actions/_utils.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,13 @@ def __init__(self, info):
145145
self.value = str(value)
146146

147147

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

153-
def __init__(self, mapping):
154-
self.uuid = UUID(mapping["uuid"])
155-
self.devnode = str(mapping["devnode"])
153+
uuid: UUID
154+
devnode: str
156155

157156

158157
class StoppedPool(BaseModel):

0 commit comments

Comments
 (0)