Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id C7E73E00848; Mon, 27 Oct 2014 08:32:28 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.212.176 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 4FE49E00796 for ; Mon, 27 Oct 2014 08:32:18 -0700 (PDT) Received: by mail-wi0-f176.google.com with SMTP id n3so6719655wiv.9 for ; Mon, 27 Oct 2014 08:32:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=pQgNQowZEVdtgLpyJ2fgKijv1lk3DDVcnnPdw7Tpwqk=; b=fXLtg4PAlCT1qiluapxNJ5Ll46P6wf+UH8zFzJ9gwq+AFpGuB4J8vvBVYqSUVBXY3T zTX49AL3Bn0CfN6wl2MS79HgHdcj4x/p80r2aBPOtMY9BYcXAA15FWrizxby93ywypxn PQ52o4/OE9VrKHXh0am8r3XpAv0Thw/6XENCy8Vbafyue3uCmXTitV88QdZ5cTLJldSw sQ0FdOX/2fY6Gl9zTUJ8H4Fj1XawyNey3d/WVxmbxSJ1oGIH+kIOrObqgKHJyNtry8lo Ai2lVBbgx4F6ZyhsItRDo6e2eVGa6/sHMZv+m1UxxKBtJ15sVe3+vRlHsrSf6QWOQDE4 I3bA== X-Gm-Message-State: ALoCoQk12N7DyYDymz44xuy8HtmZYCstVRwsft7j2Ow//dLZgvAKWOwIcFZN612FavT6vzislryM X-Received: by 10.194.240.68 with SMTP id vy4mr23717173wjc.36.1414423937101; Mon, 27 Oct 2014 08:32:17 -0700 (PDT) Received: from draco.icx.intel.com ([83.217.123.106]) by mx.google.com with ESMTPSA id ic4sm12239628wid.19.2014.10.27.08.32.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 27 Oct 2014 08:32:16 -0700 (PDT) From: Michael Wood To: toaster@yoctoproject.org Date: Mon, 27 Oct 2014 15:31:38 +0000 Message-Id: <1414423898-12128-1-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 1.9.1 Subject: [PATCH] bitbake: toaster: skip virtualenv when searching for django apps X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 15:32:28 -0000 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] Signed-off-by: Michael Wood --- bitbake/lib/toaster/toastermain/settings.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py index 42581f2..65f1991 100644 --- a/bitbake/lib/toaster/toastermain/settings.py +++ b/bitbake/lib/toaster/toastermain/settings.py @@ -260,6 +260,10 @@ import os currentdir = os.path.dirname(__file__) for t in os.walk(os.path.dirname(currentdir)): modulename = os.path.basename(t[0]) + #if we have a virtualenv skip it to avoid incorrect imports + if os.environ.has_key('VIRTUAL_ENV') and os.environ['VIRTUAL_ENV'] in t[0]: + continue + if ("views.py" in t[2] or "models.py" in t[2]) and not modulename in INSTALLED_APPS: INSTALLED_APPS = INSTALLED_APPS + (modulename,) -- 1.9.1