Fix serialisation of enum values by encoding as int
This commit is contained in:
parent
37a5a2b99f
commit
37343c339e
@ -28,7 +28,7 @@ class DockerContainer(Recipe):
|
||||
async def cook(self, kitchen: Kitchen) -> None:
|
||||
kitchen.get_dependency_tracker()
|
||||
|
||||
current_state = await kitchen.ut1(DockerContainerState(self.name))
|
||||
current_state = ContainerState(await kitchen.ut1(DockerContainerState(self.name)))
|
||||
|
||||
if current_state == ContainerState.NOTFOUND:
|
||||
await kitchen.ut1areq(
|
||||
|
@ -51,16 +51,16 @@ class DockerContainerState(Utensil):
|
||||
container: Container
|
||||
if self.name == container.name:
|
||||
if container.status == "running":
|
||||
await channel.send(ContainerState.RUNNING)
|
||||
await channel.send(ContainerState.RUNNING.value)
|
||||
elif container.status == "exited":
|
||||
await channel.send(ContainerState.EXITED)
|
||||
await channel.send(ContainerState.EXITED.value)
|
||||
elif container.status == "restarting":
|
||||
await channel.send(ContainerState.RESTARTING)
|
||||
await channel.send(ContainerState.RESTARTING.value)
|
||||
else:
|
||||
raise ValueError(f"Unknown container status: {container.status}")
|
||||
break
|
||||
else:
|
||||
await channel.send(ContainerState.NOTFOUND)
|
||||
await channel.send(ContainerState.NOTFOUND.value)
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
|
Loading…
Reference in New Issue
Block a user