diff mbox series

[1/2] cooker/command: Drop async command handler indirection via cooker

Message ID 20230110160302.1470163-1-richard.purdie@linuxfoundation.org
State Accepted, archived
Commit 4a41a7d0594e6a84a67b9de70a505858aebcd84a
Headers show
Series [1/2] cooker/command: Drop async command handler indirection via cooker | expand

Commit Message

Richard Purdie Jan. 10, 2023, 4:03 p.m. UTC
Indirecting the async command handler via cooker is confusing and no
longer needed. Drop it to make things slightly clearer.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/command.py | 4 ++--
 lib/bb/cooker.py  | 9 ---------
 2 files changed, 2 insertions(+), 11 deletions(-)
diff mbox series

Patch

diff --git a/lib/bb/command.py b/lib/bb/command.py
index 5d321cf9fa..c325abbcda 100644
--- a/lib/bb/command.py
+++ b/lib/bb/command.py
@@ -108,10 +108,10 @@  class Command:
         if command not in CommandsAsync.__dict__:
             return None, "No such command"
         self.currentAsyncCommand = (command, commandline)
-        self.cooker.idleCallBackRegister(self.cooker.runCommands, self.cooker)
+        self.cooker.idleCallBackRegister(self.runAsyncCommand, None)
         return True, None
 
-    def runAsyncCommand(self):
+    def runAsyncCommand(self, _, _2, halt):
         try:
             self.cooker.process_inotify_updates_apply()
             if self.cooker.state in (bb.cooker.state.error, bb.cooker.state.shutdown, bb.cooker.state.forceshutdown):
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index d2c42c858d..13d6e9d847 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -535,15 +535,6 @@  class BBCooker:
             logger.debug("Base environment change, triggering reparse")
             self.reset()
 
-    def runCommands(self, server, data, halt):
-        """
-        Run any queued asynchronous command
-        This is done by the idle handler so it runs in true context rather than
-        tied to any UI.
-        """
-
-        return self.command.runAsyncCommand()
-
     def showVersions(self):
 
         (latest_versions, preferred_versions, required) = self.findProviders()