Skip to contentSkip to conversation

tinfoil: Allow run_command not to wait on events

PATCH New Richard Purdie 1 participant 1 message Mar 24, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tinfoil: Allow run_command not to wait on events

There are some commands where we want to see the events returned so allow the caller to request this. This also allows us to fix an infamous bug in the tinfoil testsuite in OE-Core.

---
 lib/bb/tinfoil.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/bb/tinfoil.py +2 -2
index 27a341541a..42e453469c 100644
@@ -448,7 +448,7 @@ class Tinfoil:
         self.run_actions(config_params)
         self.recipes_parsed = True
 
-    def run_command(self, command, *params):
+    def run_command(self, command, *params, handle_events=True):
         """
         Run a command on the server (as implemented in bb.command).
         Note that there are two types of command - synchronous and
@@ -468,7 +468,7 @@ class Tinfoil:
         try:
             result = self.server_connection.connection.runCommand(commandline)
         finally:
-            while True:
+            while handle_events:
                 event = self.wait_event()
                 if not event:
                     break
Signature · 1 line
2.32.0