]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
uievent: add error to registerEventHandler return
authorEd Bartosh <ed.bartosh@linux.intel.com>
Thu, 31 Dec 2015 16:42:14 +0000 (18:42 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 5 Jan 2016 17:59:13 +0000 (17:59 +0000)
Current code throws Exception("Could not register UI event handler")
if event handler can't be registered. The real reason of this is that
cooker is in busy state. Error message lacks information about this.

Added error message to the return value of registerEventHandler.
Included returned error message into the log message and exception
text.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/server/xmlrpc.py
lib/bb/ui/uievent.py

index b7647c198f94a64bd5550e40859285f2ca50b1a7..17eb28b7d423161d8beb3b33f81599740b1d4e30 100644 (file)
@@ -97,10 +97,10 @@ class BitBakeServerCommands():
 
         # we don't allow connections if the cooker is running
         if (self.cooker.state in [bb.cooker.state.parsing, bb.cooker.state.running]):
-            return None
+            return None, "Cooker is busy: %s" % bb.cooker.state.get_name(self.cooker.state)
 
         self.event_handle = bb.event.register_UIHhandler(s, True)
-        return self.event_handle
+        return self.event_handle, 'OK'
 
     def unregisterEventHandler(self, handlerNum):
         """
index 7fc50c759aa6394d53b03590e1278e8414faa226..80686a65bea7330ab11347cdafbed43457c0f7d4 100644 (file)
@@ -52,19 +52,21 @@ class BBUIEventQueue:
         # giving up
 
         while self.EventHandler == None and count_tries < 5:
-            self.EventHandle = self.BBServer.registerEventHandler(self.host, self.port)
+            self.EventHandle, error = self.BBServer.registerEventHandler(self.host, self.port)
 
             if (self.EventHandle != None):
                 break
 
-            bb.warn("Could not register UI event handler %s:%d, retry" % (self.host, self.port))
+            errmsg = "Could not register UI event handler. Error: %s, " \
+                     "host %s, port %d" % (error, self.host, self.port)
+            bb.warn("%s, retry" % errmsg)
             count_tries += 1
             import time
             time.sleep(1)
 
 
         if self.EventHandle == None:
-            raise Exception("Could not register UI event handler")
+            raise Exception(errmsg)
 
         self.server = server