1
0
mirror of https://git.yoctoproject.org/poky synced 2026-07-26 07:07:08 +00:00

bitbake: cooker: use enum for cooker state to improve readability

enum was introduced in Python 3.4

(Bitbake rev: 35b71a94f8757fcca830f972a42edab1dd000c16)

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Chris Laplante
2024-12-04 12:30:11 -05:00
committed by Richard Purdie
parent 2a34c96b8b
commit 9cabda06ab
3 changed files with 32 additions and 34 deletions
+2 -2
View File
@@ -103,8 +103,8 @@ class BitBakeXMLRPCServerCommands:
s, t = bb.server.xmlrpcclient._create_server(host, port)
# we don't allow connections if the cooker is running
if (self.server.cooker.state in [bb.cooker.state.parsing, bb.cooker.state.running]):
return None, "Cooker is busy: %s" % bb.cooker.state.get_name(self.server.cooker.state)
if self.server.cooker.state in [bb.cooker.State.PARSING, bb.cooker.State.RUNNING]:
return None, f"Cooker is busy: {self.server.cooker.state.name}"
self.event_handle = bb.event.register_UIHhandler(s, True)
return self.event_handle, 'OK'