]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: toaster: Start Django machinery for database access
authorElliot Smith <elliot.smith@intel.com>
Thu, 10 Dec 2015 03:56:30 +0000 (19:56 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 14 Dec 2015 23:13:06 +0000 (23:13 +0000)
buildinfohelper, with the new import paths for our Django models
and Django 1.8, was not getting an active connection to the database.

In buildinfohelper, call django.setup() explicitly to make sure
that the database connection is ready and models can be queried
and saved.

[YOCTO #8364]

(Bitbake rev: 671aaab8cb7c494cd5c7621b45a6f41a203d8bb5)

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>
bitbake/lib/bb/ui/buildinfohelper.py

index 87e03e7c6197c7fbff57ce9e24dda6c674f265af..04ce23afcb0e67179954a1e4b52328e986e36210 100644 (file)
@@ -24,6 +24,7 @@ import os
 os.environ["DJANGO_SETTINGS_MODULE"] = "toaster.toastermain.settings"
 
 
+import django
 from django.utils import timezone
 
 
@@ -33,6 +34,8 @@ def _configure_toaster():
     sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'toaster'))
 _configure_toaster()
 
+django.setup()
+
 from orm.models import Build, Task, Recipe, Layer_Version, Layer, Target, LogMessage, HelpText
 from orm.models import Target_Image_File, BuildArtifact
 from orm.models import Variable, VariableHistory