All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ed Bartosh <ed.bartosh@linux.intel.com>
To: toaster@yoctoproject.org
Subject: [PATCH v6 23/41] toaster: update BuildEnvironmentController and BitbakeController
Date: Wed, 23 Mar 2016 10:15:14 +0200	[thread overview]
Message-ID: <a3dee25388d08ab53194360b3913f1925ce09c19.1458720709.git.ed.bartosh@linux.intel.com> (raw)
In-Reply-To: <cover.1458720709.git.ed.bartosh@linux.intel.com>
In-Reply-To: <cover.1458720709.git.ed.bartosh@linux.intel.com>

From: Sujith H <sujith.h@gmail.com>

Remove getBBController function from BuildEnvironmentController.
The constructor of BitbakeController is updated appropriately so that
call can be made to connect to running server.
The call to startBBServer is removed from bbcontroller and  handledin
localhostbecontroller.

[YOCTO #6787]

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 bitbake/lib/toaster/bldcontrol/bbcontroller.py     | 26 ++++------------------
 .../toaster/bldcontrol/localhostbecontroller.py    |  2 +-
 2 files changed, 5 insertions(+), 23 deletions(-)

diff --git a/bitbake/lib/toaster/bldcontrol/bbcontroller.py b/bitbake/lib/toaster/bldcontrol/bbcontroller.py
index 0f7b66d..d09ac17 100644
--- a/bitbake/lib/toaster/bldcontrol/bbcontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/bbcontroller.py
@@ -37,11 +37,12 @@ class BitbakeController(object):
         It is outside the scope of this class on how the server is started and aquired
     """
 
-    def __init__(self, connection):
-        self.connection = connection
+    def __init__(self, be):
+        self.connection = bb.server.xmlrpc._create_server(be.bbaddress,
+                                                          int(be.bbport))[0]
 
     def _runCommand(self, command):
-        result, error = self.connection.connection.runCommand(command)
+        result, error = self.connection.runCommand(command)
         if error:
             raise Exception(error)
         return result
@@ -122,25 +123,6 @@ class BuildEnvironmentController(object):
         """
         raise NotImplementedError("FIXME: Must override setLayers")
 
-
-    def getBBController(self):
-        """ returns a BitbakeController to an already started server; this is the point where the server
-            starts if needed; or reconnects to the server if we can
-        """
-        if not self.connection:
-            self.be.lock = BuildEnvironment.LOCK_RUNNING
-            self.be.save()
-
-        server = bb.server.xmlrpc.BitBakeXMLRPCClient()
-        server.initServer()
-        server.saveConnectionDetails("%s:%s" % (self.be.bbaddress, self.be.bbport))
-        self.connection = server.establishConnection([])
-
-        self.be.bbtoken = self.connection.transport.connection_token
-        self.be.save()
-
-        return BitbakeController(self.connection)
-
     def getArtifact(self, path):
         """ This call returns an artifact identified by the 'path'. How 'path' is interpreted as
             up to the implementing BEC. The return MUST be a REST URL where a GET will actually return
diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
index e891ff0..7d6801cb 100644
--- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -32,7 +32,7 @@ import subprocess
 
 from toastermain import settings
 
-from bbcontroller import BuildEnvironmentController, ShellCmdException, BuildSetupException
+from bbcontroller import BuildEnvironmentController, ShellCmdException, BuildSetupException, BitbakeController
 
 import logging
 logger = logging.getLogger("toaster")
-- 
2.1.4



  parent reply	other threads:[~2016-03-23 10:37 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-23  8:14 [PATCH v6 00/41] per project build directory + build cancel + DL_DIR/SSTATE_DIR Ed Bartosh
2016-03-23  8:14 ` [PATCH v6 01/41] toaster: don't start bitbake server Ed Bartosh
2016-03-23  8:14 ` [PATCH v6 02/41] toaster: get rid of noui option Ed Bartosh
2016-03-23  8:14 ` [PATCH v6 03/41] toaster: set BITBAKE_UI environment variable Ed Bartosh
2016-03-23  8:14 ` [PATCH v6 04/41] toasterui: add brbe parameter to buildinfohelper Ed Bartosh
2016-03-23  8:14 ` [PATCH v6 05/41] uievent: improve BBUIEventQueue code Ed Bartosh
2016-03-23  8:14 ` [PATCH v6 06/41] buildinfohelper: improve handling of providermap Ed Bartosh
2016-03-23  8:14 ` [PATCH v6 07/41] toasterui: fix brbe reporting Ed Bartosh
2016-03-23  8:14 ` [PATCH v6 08/41] toaster: remove startBBServer API Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 09/41] toaster: remove release API Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 10/41] toaster: add brbe parameter to triggerBuild Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 11/41] toaster: modified setLayers API Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 12/41] toaster: reimplement triggerBuild Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 13/41] toaster: add new parameter to _shellcmd Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 14/41] toaster: stop bitbake server after the build Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 15/41] toaster: update conf/local.conf Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 16/41] toaster: fix jethro build Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 17/41] toaster: use bash explicitly Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 18/41] toasterui: shutdown on BuildCompleted event Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 19/41] toaster: bldcontrol Add forceShutDown function to BitbakeController Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 20/41] toaster: Move xhr calls for starting and stopping builds Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 21/41] toaster: xhr Update the implementation of the build cancellation request Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 22/41] toaster: libtoaster Update implementation of startABuild and cancelABuild Ed Bartosh
2016-03-23  8:15 ` Ed Bartosh [this message]
2016-03-23  8:15 ` [PATCH v6 24/41] toaster: models Add cancelled state to build outcome Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 25/41] toaster: bldcontrol models Add a cancelling state the BuildRequest Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 26/41] buildinfohelper: Add handler for cancelling a build Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 27/41] toaster: tables BuildsTable exclude cancelled builds Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 28/41] toaster: mrb_section template Add build cancel button Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 29/41] toaster: models Exclude the CANCELLED builds from get_number_of_builds Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 30/41] toaster: runbuilds Make runbuilds aware of the build CANCELLED state Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 31/41] toaster: runbuilds Clean up runbuilds Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 32/41] toaster: fix conflicting migrations Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 33/41] toaster: use empty token Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 34/41] toaster: add DL_DIR and SSTATE_DIR to poky toasterconf Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 35/41] toaster: add DL_DIR and SSTATE_DIR to oe toasterconf Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 36/41] toaster: update view to support DL_DIR and SSTATE_DIR Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 37/41] toaster: update projectconf.html for " Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 38/41] toaster: use bitbake from sourcedir/bitbake/bin Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 39/41] toasterui: detect build run start correctly on Jethro Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 40/41] buildinfohelper: fix KeyError Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 41/41] toasterui: fix warning 'Unknown event' Ed Bartosh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a3dee25388d08ab53194360b3913f1925ce09c19.1458720709.git.ed.bartosh@linux.intel.com \
    --to=ed.bartosh@linux.intel.com \
    --cc=toaster@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.