mirror of
https://github.com/home-assistant/operating-system.git
synced 2026-02-23 19:26:35 +00:00
* Update Buildroot to 2019-02.3 * Fix enter script * Update ova_defconfig * Fix network manager * Remove runc patches * Use same docker version * Fix build * Fix vmtools * Fix depens * Fix handling with tempfiles * Fix permission handling * Fix cp * Cleanup * Fix mounts
20 lines
404 B
Python
20 lines
404 B
Python
from constantly import ValueConstant, Values
|
|
|
|
|
|
class RESULT(Values):
|
|
OK = ValueConstant(0)
|
|
FAIL = ValueConstant(-1)
|
|
|
|
@classmethod
|
|
def get(cls, rc):
|
|
if rc == 0:
|
|
return cls.OK
|
|
else:
|
|
return cls.FAIL
|
|
|
|
|
|
print(list(RESULT.iterconstants()))
|
|
assert(RESULT.OK < RESULT.FAIL)
|
|
assert(RESULT.OK.value > RESULT.FAIL.value)
|
|
assert(RESULT.get(-5) == RESULT.FAIL)
|