diff options
author | Michael Wood <michael.g.wood@intel.com> | 2016-05-19 13:59:28 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-20 10:09:02 +0100 |
commit | db843070554fe9bd518103ab922284b510ead7b5 (patch) | |
tree | 66287d8ef8d3f6c39028cd3794ea44b98ed11f68 /bitbake/lib/bb/ui | |
parent | 8fba59ce45de865354b0b115e1b33f5a59172614 (diff) | |
download | poky-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.py | 20 |
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 | |||
21 | import re | 21 | import re |
22 | import os | 22 | import os |
23 | 23 | ||
24 | os.environ["DJANGO_SETTINGS_MODULE"] = "toaster.toastermain.settings" | ||
25 | |||
26 | |||
27 | import django | 24 | import django |
28 | from django.utils import timezone | 25 | from django.utils import timezone |
29 | 26 | ||
27 | import toaster | ||
28 | # Add toaster module to the search path to help django.setup() find the right | ||
29 | # modules | ||
30 | sys.path.insert(0, os.path.dirname(toaster.__file__)) | ||
30 | 31 | ||
31 | def _configure_toaster(): | 32 | #Set the DJANGO_SETTINGS_MODULE if it's not already set |
32 | """ Add toaster to sys path for importing modules | 33 | os.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 | |||
37 | django.setup() | 37 | django.setup() |
38 | 38 | ||
39 | 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 |
@@ -54,11 +54,11 @@ from datetime import datetime, timedelta | |||
54 | 54 | ||
55 | from django.db import transaction, connection | 55 | from 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 |
59 | logger = logging.getLogger("ToasterLogger") | 60 | logger = logging.getLogger("ToasterLogger") |
60 | 61 | ||
61 | |||
62 | class NotExisting(Exception): | 62 | class NotExisting(Exception): |
63 | pass | 63 | pass |
64 | 64 | ||