summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/bldcontrol
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/toaster/bldcontrol')
-rw-r--r--bitbake/lib/toaster/bldcontrol/bbcontroller.py26
-rw-r--r--bitbake/lib/toaster/bldcontrol/localhostbecontroller.py2
2 files changed, 5 insertions, 23 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/bbcontroller.py b/bitbake/lib/toaster/bldcontrol/bbcontroller.py
index 0f7b66d2e6..d09ac17875 100644
--- a/bitbake/lib/toaster/bldcontrol/bbcontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/bbcontroller.py
@@ -37,11 +37,12 @@ class BitbakeController(object):
37 It is outside the scope of this class on how the server is started and aquired 37 It is outside the scope of this class on how the server is started and aquired
38 """ 38 """
39 39
40 def __init__(self, connection): 40 def __init__(self, be):
41 self.connection = connection 41 self.connection = bb.server.xmlrpc._create_server(be.bbaddress,
42 int(be.bbport))[0]
42 43
43 def _runCommand(self, command): 44 def _runCommand(self, command):
44 result, error = self.connection.connection.runCommand(command) 45 result, error = self.connection.runCommand(command)
45 if error: 46 if error:
46 raise Exception(error) 47 raise Exception(error)
47 return result 48 return result
@@ -122,25 +123,6 @@ class BuildEnvironmentController(object):
122 """ 123 """
123 raise NotImplementedError("FIXME: Must override setLayers") 124 raise NotImplementedError("FIXME: Must override setLayers")
124 125
125
126 def getBBController(self):
127 """ returns a BitbakeController to an already started server; this is the point where the server
128 starts if needed; or reconnects to the server if we can
129 """
130 if not self.connection:
131 self.be.lock = BuildEnvironment.LOCK_RUNNING
132 self.be.save()
133
134 server = bb.server.xmlrpc.BitBakeXMLRPCClient()
135 server.initServer()
136 server.saveConnectionDetails("%s:%s" % (self.be.bbaddress, self.be.bbport))
137 self.connection = server.establishConnection([])
138
139 self.be.bbtoken = self.connection.transport.connection_token
140 self.be.save()
141
142 return BitbakeController(self.connection)
143
144 def getArtifact(self, path): 126 def getArtifact(self, path):
145 """ This call returns an artifact identified by the 'path'. How 'path' is interpreted as 127 """ This call returns an artifact identified by the 'path'. How 'path' is interpreted as
146 up to the implementing BEC. The return MUST be a REST URL where a GET will actually return 128 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 73c5f1ff80..d23634fb8f 100644
--- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -32,7 +32,7 @@ import subprocess
32 32
33from toastermain import settings 33from toastermain import settings
34 34
35from bbcontroller import BuildEnvironmentController, ShellCmdException, BuildSetupException 35from bbcontroller import BuildEnvironmentController, ShellCmdException, BuildSetupException, BitbakeController
36 36
37import logging 37import logging
38logger = logging.getLogger("toaster") 38logger = logging.getLogger("toaster")