diff options
author | Michael Wood <michael.g.wood@intel.com> | 2014-10-27 19:03:06 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-11-21 11:49:23 +0000 |
commit | 5b0616ad7d7c3734f1818a56b631a2d254271678 (patch) | |
tree | 6e9387b0b72536ff60746b58ea998e40620663fa | |
parent | 2f3e40c5d8dfe7cc43511b95149f8d28f663ed1d (diff) | |
download | poky-5b0616ad7d7c3734f1818a56b631a2d254271678.tar.gz |
bitbake: toaster: skip virtualenv when searching for django apps
If we are using a virtualenv in the current search path we end up trying
to add modules to the django apps list which do not have the correct
load path or are internal to other modules. Fix this by skipping the
virtualenv path.
[YOCTO #6896]
(Bitbake rev: 3f614295d688c33b690f63ff7eb28e6988707919)
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/toaster/toastermain/settings.py | 4 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastermain/urls.py | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py index 8de3b52f34..0974b90525 100644 --- a/bitbake/lib/toaster/toastermain/settings.py +++ b/bitbake/lib/toaster/toastermain/settings.py | |||
@@ -264,6 +264,10 @@ import os | |||
264 | currentdir = os.path.dirname(__file__) | 264 | currentdir = os.path.dirname(__file__) |
265 | for t in os.walk(os.path.dirname(currentdir)): | 265 | for t in os.walk(os.path.dirname(currentdir)): |
266 | modulename = os.path.basename(t[0]) | 266 | modulename = os.path.basename(t[0]) |
267 | #if we have a virtualenv skip it to avoid incorrect imports | ||
268 | if os.environ.has_key('VIRTUAL_ENV') and os.environ['VIRTUAL_ENV'] in t[0]: | ||
269 | continue | ||
270 | |||
267 | if ("views.py" in t[2] or "models.py" in t[2]) and not modulename in INSTALLED_APPS: | 271 | if ("views.py" in t[2] or "models.py" in t[2]) and not modulename in INSTALLED_APPS: |
268 | INSTALLED_APPS = INSTALLED_APPS + (modulename,) | 272 | INSTALLED_APPS = INSTALLED_APPS + (modulename,) |
269 | 273 | ||
diff --git a/bitbake/lib/toaster/toastermain/urls.py b/bitbake/lib/toaster/toastermain/urls.py index 1ae6245cc3..549fda12d6 100644 --- a/bitbake/lib/toaster/toastermain/urls.py +++ b/bitbake/lib/toaster/toastermain/urls.py | |||
@@ -55,6 +55,10 @@ if toastermain.settings.MANAGED: | |||
55 | import os | 55 | import os |
56 | currentdir = os.path.dirname(__file__) | 56 | currentdir = os.path.dirname(__file__) |
57 | for t in os.walk(os.path.dirname(currentdir)): | 57 | for t in os.walk(os.path.dirname(currentdir)): |
58 | #if we have a virtualenv skip it to avoid incorrect imports | ||
59 | if os.environ.has_key('VIRTUAL_ENV') and os.environ['VIRTUAL_ENV'] in t[0]: | ||
60 | continue | ||
61 | |||
58 | if "urls.py" in t[2] and t[0] != currentdir: | 62 | if "urls.py" in t[2] and t[0] != currentdir: |
59 | modulename = os.path.basename(t[0]) | 63 | modulename = os.path.basename(t[0]) |
60 | urlpatterns.append( url(r'^' + modulename + '/', include ( modulename + '.urls'))) | 64 | urlpatterns.append( url(r'^' + modulename + '/', include ( modulename + '.urls'))) |