summaryrefslogtreecommitdiffstats
path: root/lib/toaster/bldcontrol/localhostbecontroller.py
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-12-09 19:56:38 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-14 23:12:44 +0000
commitaaa4319ebbb06facb77b4ba936cf3aa2068ff238 (patch)
treee14929de32dbd8dbef3ff762415d5bb55e536c2f /lib/toaster/bldcontrol/localhostbecontroller.py
parent89386aab888f806d5aa4a8083c06566e48d9445b (diff)
downloadbitbake-aaa4319ebbb06facb77b4ba936cf3aa2068ff238.tar.gz
toaster: use OneToOneField instead of ForeignKey
Used OneToOneField to reference BuildRequest in BRBitbake model. Fixed django warning: WARNINGS: Setting unique=True on a ForeignKey has the same effect as using a OneToOneField. Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/toaster/bldcontrol/localhostbecontroller.py')
-rw-r--r--lib/toaster/bldcontrol/localhostbecontroller.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/toaster/bldcontrol/localhostbecontroller.py b/lib/toaster/bldcontrol/localhostbecontroller.py
index 00228e9ef..4f6f15c60 100644
--- a/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -115,18 +115,17 @@ class LocalhostBEController(BuildEnvironmentController):
return local_checkout_path
- def setLayers(self, bitbakes, layers, targets):
+ def setLayers(self, bitbake, layers, targets):
""" a word of attention: by convention, the first layer for any build will be poky! """
assert self.be.sourcedir is not None
- assert len(bitbakes) == 1
# set layers in the layersource
# 1. get a list of repos with branches, and map dirpaths for each layer
gitrepos = {}
- gitrepos[(bitbakes[0].giturl, bitbakes[0].commit)] = []
- gitrepos[(bitbakes[0].giturl, bitbakes[0].commit)].append( ("bitbake", bitbakes[0].dirpath) )
+ gitrepos[(bitbake.giturl, bitbake.commit)] = []
+ gitrepos[(bitbake.giturl, bitbake.commit)].append( ("bitbake", bitbake.dirpath) )
for layer in layers:
# we don't process local URLs
@@ -198,7 +197,7 @@ class LocalhostBEController(BuildEnvironmentController):
# make sure we have a working bitbake
if not os.path.exists(os.path.join(self.pokydirname, 'bitbake')):
logger.debug("localhostbecontroller: checking bitbake into the poky dirname %s " % self.pokydirname)
- self._shellcmd("git clone -b \"%s\" \"%s\" \"%s\" " % (bitbakes[0].commit, bitbakes[0].giturl, os.path.join(self.pokydirname, 'bitbake')))
+ self._shellcmd("git clone -b \"%s\" \"%s\" \"%s\" " % (bitbake.commit, bitbake.giturl, os.path.join(self.pokydirname, 'bitbake')))
# verify our repositories
for name, dirpath in gitrepos[(giturl, commit)]:
@@ -224,7 +223,7 @@ class LocalhostBEController(BuildEnvironmentController):
for target in targets:
try:
customrecipe = CustomImageRecipe.objects.get(name=target.target,
- project=bitbakes[0].req.project)
+ project=bitbake.req.project)
except CustomImageRecipe.DoesNotExist:
continue # not a custom recipe, skip
@@ -278,7 +277,7 @@ class LocalhostBEController(BuildEnvironmentController):
def triggerBuild(self, bitbake, layers, variables, targets):
- # set up the buid environment with the needed layers
+ # set up the build environment with the needed layers
self.setLayers(bitbake, layers, targets)
# get the bb server running with the build req id and build env id