Resend:[Image-Creator]Make bitbake server type configurable (xmlrpc, none)
cover Resend:[Image-Creator]Make bitbake server type configurable (xmlrpc, none)
From: Liping Ke <[email protected]>
Add -t options in bitbake for configuring server type.
Pull URL: git://git.pokylinux.org/poky-contrib.git
Branch: lke/server_type
Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=lke/server_type
Thanks,
Liping Ke <[email protected]>
---
Liping Ke (1):
Make bitbake server type configurable (xmlrpc, none)
bitbake/bin/bitbake | 22 +++++++++++++++++----- 1 files changed, 17 insertions(+), 5 deletions(-)
(No subject)
From: Liping Ke <[email protected]>
Subject: [PATCH 1/1] Resend:[Image-Creator]Make bitbake server type configurable (xmlrpc, none)
Add -t options in bitbake for configuring server type.
--- bitbake/bin/bitbake | 22 +++++++++++++++++----- 1 files changed, 17 insertions(+), 5 deletions(-)
bitbake/bin/bitbake +17 -5
@@ -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,19 @@ 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' + + try: + module = __import__("bb.server", fromlist = [server_type]) + server = getattr(module, server_type) + except AttributeError: + sys.exit("FATAL: Invalid server type '%s' specified.\n" + "Valid interfaces: xmlrpc [default]." % servertype) # Save a logfile for cooker into the current working directory. When the # server is daemonized this logfile will be truncated.
Signature · 1 line
1.7.0.4
Hi Liping,
This looks good to me. Two minor typo nits below, once they're fixed I will create a branch on poky-contrib to collect image-creator related patches until we're ready to switch to developing against upstream bitbake.
Thanks,
Joshua
Quoted 32 lines · Liping Ke
From: Liping Ke <[email protected]>
Add -t options in bitbake for configuring server type.
Signed-off-by Liping Ke <[email protected]>--- bitbake/bin/bitbake | 22 +++++++++++++++++----- 1 files changed, 17 insertions(+), 5 deletions(-)bitbake/bin/bitbake +1
-3@@ -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"""
bitbake/bin/bitbake Default BBFILES are the .bb files in the current directory.""") · line 162
Quoted 4 lines
bitbake/bin/bitbake +1
-0@@ -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",
Can you capitalise choose please?
Quoted 14 lines
bitbake/bin/bitbake +5
-2+ 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,19 @@ 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:
bitbake/bin/bitbake Default BBFILES are the .bb files in the current directory.""") · line 191
Quoted 10 lines
bitbake/bin/bitbake +10
-0+ server_type = configuration.servertype + else: + server_type = 'none' + + try: + module = __import__("bb.server", fromlist = [server_type]) + server = getattr(module, server_type) + except AttributeError: + sys.exit("FATAL: Invalid server type '%s' specified.\n" + "Valid interfaces: xmlrpc [default]." % servertype)
+ "Valid interfaces: xmlrpc, none [default]." %
servertype)
xmlrpc isn't the default, none is :-)
Quoted 3 lines
bitbake/bin/bitbake +0
-0# Save a logfile for cooker into the current working directory. When the # server is daemonized this logfile will be truncated.
Signature · 3 lines
Joshua Lock
Yocto Build System Monkey
Intel Open Source Technology CenterHi, Josh
Thanks for your very careful review indeed! I will correct them and resend the patch!
Regards,
criping
Quoted 17 lines
-----Original Message-----
From: Joshua Lock [mailto:[email protected]]
Sent: Friday, April 29, 2011 4:32 AM
To: Ke, Liping
Cc: [email protected]
Subject: Re: [yocto] [PATCH 1/1] Resend:[Image-Creator]Make bitbake server type configurable (xmlrpc, none)Hi Liping,
This looks good to me. Two minor typo nits below, once they're fixed I will create a branch on poky-contrib to collect image-creator related patches until we're ready to switch to developing against upstream bitbake.
Thanks,
Joshua