Patchwork [1/1] Image Creator: Make bitbake server type configuration (xmlrpc, none)

login
register
mail settings
Submitter Liping Ke
Date April 27, 2011, 7:45 a.m.
Message ID <904d24a2315fcb32d56e0c166ce27d99106a3d9e.1303889896.git.liping.ke@intel.com>
Download mbox | patch
Permalink /patch/2997/
State New, archived
Headers show

Comments

Liping Ke - April 27, 2011, 7:45 a.m.
From: Liping Ke <liping.ke@intel.com>

Add -t parameters for configuring xmlrpc or none server.

Signed-off-by: Liping Ke <liping.ke@intel.com>
---
 bitbake/bin/bitbake |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

Patch

diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake
index 6d05289..754517a 100755
--- a/bitbake/bin/bitbake
+++ b/bitbake/bin/bitbake
@@ -39,8 +39,6 @@  import bb.msg
 from bb import cooker
 from bb import ui
 from bb import server
-from bb.server import none
-#from bb.server import xmlrpc
 
 __version__ = "1.11.0"
 logger = logging.getLogger("BitBake")
@@ -71,7 +69,7 @@  def get_ui(config):
         return getattr(module, interface).main
     except AttributeError:
         sys.exit("FATAL: Invalid user interface '%s' specified.\n"
-                 "Valid interfaces: depexp, goggle, ncurses, knotty [default]." % interface)
+                 "Valid interfaces: depexp, goggle, ncurses, hob, knotty [default]." % interface)
 
 
 # Display bitbake/OE warnings via the BitBake.Warnings logger, ignoring others"""
@@ -161,6 +159,9 @@  Default BBFILES are the .bb files in the current directory.""")
     parser.add_option("-u", "--ui", help = "userinterface to use",
                action = "store", dest = "ui")
 
+    parser.add_option("-t", "--servertype", help = "choose which server to user, none or xmlrpc",
+               action = "store", dest = "servertype")
+
     parser.add_option("", "--revisions-changed", help = "Set the exit code depending on whether upstream floating revisions have changed or not",
                action = "store_true", dest = "revisions_changed", default = False)
 
@@ -175,8 +176,17 @@  Default BBFILES are the .bb files in the current directory.""")
     loghandler = event.LogHandler()
     logger.addHandler(loghandler)
 
-    #server = bb.server.xmlrpc
-    server = bb.server.none
+    # Server type could be xmlrpc or none currently, if nothing is specified,
+    # default server would be none
+    if configuration.servertype:
+        server_type = configuration.servertype
+    else:
+        server_type = 'none'
+
+    module = __import__("bb.server", fromlist = [server_type])
+    server = getattr(module, server_type)
+
+    print ("lke: servertype: ", server_type)
 
     # Save a logfile for cooker into the current working directory. When the
     # server is daemonized this logfile will be truncated.