diff options
author | Elliot Smith <elliot.smith@intel.com> | 2015-12-09 19:56:30 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-12-14 23:13:06 +0000 |
commit | 23c48065d2b44c4ff6f893aead30f64f3524712a (patch) | |
tree | 77b6404013488368a6498b4f698138eef2b7c865 | |
parent | 7a0c45e478fac9de2bae63544f7e98187ceb59a7 (diff) | |
download | poky-23c48065d2b44c4ff6f893aead30f64f3524712a.tar.gz |
bitbake: toaster: Start Django machinery for database access
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>
-rw-r--r-- | bitbake/lib/bb/ui/buildinfohelper.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py index 87e03e7c61..04ce23afcb 100644 --- a/bitbake/lib/bb/ui/buildinfohelper.py +++ b/bitbake/lib/bb/ui/buildinfohelper.py | |||
@@ -24,6 +24,7 @@ import os | |||
24 | os.environ["DJANGO_SETTINGS_MODULE"] = "toaster.toastermain.settings" | 24 | os.environ["DJANGO_SETTINGS_MODULE"] = "toaster.toastermain.settings" |
25 | 25 | ||
26 | 26 | ||
27 | import django | ||
27 | from django.utils import timezone | 28 | from django.utils import timezone |
28 | 29 | ||
29 | 30 | ||
@@ -33,6 +34,8 @@ def _configure_toaster(): | |||
33 | sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'toaster')) | 34 | sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'toaster')) |
34 | _configure_toaster() | 35 | _configure_toaster() |
35 | 36 | ||
37 | django.setup() | ||
38 | |||
36 | from orm.models import Build, Task, Recipe, Layer_Version, Layer, Target, LogMessage, HelpText | 39 | from orm.models import Build, Task, Recipe, Layer_Version, Layer, Target, LogMessage, HelpText |
37 | from orm.models import Target_Image_File, BuildArtifact | 40 | from orm.models import Target_Image_File, BuildArtifact |
38 | from orm.models import Variable, VariableHistory | 41 | from orm.models import Variable, VariableHistory |