Skip to contentSkip to conversation

hob/hobeventhandler: Throw an exception if runCommand fails

PATCH Applied Constantin Musca 2 participants 2 messages Oct 4, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hob/hobeventhandler: Throw an exception if runCommand fails

- throw a Hob exception if runCommand returns 'Busy' or 'No such command'

[YOCTO #1245]

---
 bitbake/lib/bb/ui/crumbs/hobeventhandler.py |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
bitbake/lib/bb/ui/crumbs/hobeventhandler.py +6 -1
index e8d7dc2..2ce5b66 100644
@@ -101,7 +101,12 @@ class HobHandler(gobject.GObject):
 
     def runCommand(self, commandline):
         try:
-            return self.server.runCommand(commandline)
+            result = self.server.runCommand(commandline)
+            result_str = str(result)
+            if (result_str.startswith("Busy (") or
+                    result_str == "No such command"):
+                raise Exception(result_str)
+            return result
         except Exception as e:
             self.commands_async = []
             self.clear_busy()
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 9 lines · Constantin Musca

- throw a Hob exception if runCommand returns 'Busy' or 'No such command'

[YOCTO #1245]

---
 bitbake/lib/bb/ui/crumbs/hobeventhandler.py |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Merged to master, thanks.

Richard