summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2016-05-19 13:59:28 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-20 10:09:02 +0100
commitdb843070554fe9bd518103ab922284b510ead7b5 (patch)
tree66287d8ef8d3f6c39028cd3794ea44b98ed11f68 /bitbake/lib/bb/ui
parent8fba59ce45de865354b0b115e1b33f5a59172614 (diff)
downloadpoky-db843070554fe9bd518103ab922284b510ead7b5.tar.gz
bitbake: toaster: Remove DATABASE_URL being passed around as an environment var
We don't need to pass the DATABASE_URL around and read it back if we setup the django framework in the correct way. We make the default sqlite database path a full path so that the database isn't being assumed to be in CWD. Also add some more useful comments on the database settings. This is preparation work to migrate the build tests and be able to trigger builds on differently configured databases. (Bitbake rev: 973c740404ca6a09feea250d3433075995067fe0) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui')
-rw-r--r--bitbake/lib/bb/ui/buildinfohelper.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index c5368f63be..cea53e053a 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -21,19 +21,19 @@ import bb
21import re 21import re
22import os 22import os
23 23
24os.environ["DJANGO_SETTINGS_MODULE"] = "toaster.toastermain.settings"
25
26
27import django 24import django
28from django.utils import timezone 25from django.utils import timezone
29 26
27import toaster
28# Add toaster module to the search path to help django.setup() find the right
29# modules
30sys.path.insert(0, os.path.dirname(toaster.__file__))
30 31
31def _configure_toaster(): 32#Set the DJANGO_SETTINGS_MODULE if it's not already set
32 """ Add toaster to sys path for importing modules 33os.environ["DJANGO_SETTINGS_MODULE"] =\
33 """ 34 os.environ.get("DJANGO_SETTINGS_MODULE",
34 sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'toaster')) 35 "toaster.toastermain.settings")
35_configure_toaster() 36# Setup django framework (needs to be done before importing modules)
36
37django.setup() 37django.setup()
38 38
39from orm.models import Build, Task, Recipe, Layer_Version, Layer, Target, LogMessage, HelpText 39from orm.models import Build, Task, Recipe, Layer_Version, Layer, Target, LogMessage, HelpText
@@ -54,11 +54,11 @@ from datetime import datetime, timedelta
54 54
55from django.db import transaction, connection 55from django.db import transaction, connection
56 56
57
57# pylint: disable=invalid-name 58# pylint: disable=invalid-name
58# the logger name is standard throughout BitBake 59# the logger name is standard throughout BitBake
59logger = logging.getLogger("ToasterLogger") 60logger = logging.getLogger("ToasterLogger")
60 61
61
62class NotExisting(Exception): 62class NotExisting(Exception):
63 pass 63 pass
64 64