Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 04E35E00CC9; Sun, 20 Aug 2017 21:02:58 -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=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, * medium trust * [147.11.146.13 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mail1.windriver.com (mail1.windriver.com [147.11.146.13]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 8CEA1E00B43 for ; Sun, 20 Aug 2017 21:02:57 -0700 (PDT) Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail1.windriver.com (8.15.2/8.15.1) with ESMTPS id v7L42uln017687 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL) for ; Sun, 20 Aug 2017 21:02:56 -0700 (PDT) Received: from ala-dreyna-lx3.corp.ad.wrs.com (147.11.157.78) by ALA-HCB.corp.ad.wrs.com (147.11.189.41) with Microsoft SMTP Server (TLS) id 14.3.361.1; Sun, 20 Aug 2017 21:02:55 -0700 From: David Reyna To: Date: Sun, 20 Aug 2017 20:54:36 -0700 Message-ID: <1503287676-9094-1-git-send-email-david.reyna@windriver.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [147.11.157.78] Subject: [PATCH] toaster: support custom Layer Index URL and fixture override 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, 21 Aug 2017 04:02:58 -0000 Content-Type: text/plain From: David Reyna Toaster needs to allow the custom fixture file to specific an alternate Layer Index URL for users that host their own Layer Index Server via the 'CUSTOM_LAYERINDEX_SERVER' in 'custom.xml'. Toaster also needs to allow the ability to completely override the default fixture files, otherwise that content can leak into the custom environment (by default the custom fixture is an overlay that cannot remove existing values from the default fixture) via the 'CUSTOM_XML_ONLY' value in 'setting.xml'. [YOCTO #11938] Signed-off-by: David Reyna --- bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py | 5 ++++- bitbake/lib/toaster/orm/management/commands/lsupdates.py | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py b/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py index d11166e..582114a 100644 --- a/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py +++ b/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py @@ -75,7 +75,10 @@ class Command(BaseCommand): call_command("loaddata", "settings") template_conf = os.environ.get("TEMPLATECONF", "") - if "poky" in template_conf: + if ToasterSetting.objects.filter(name='CUSTOM_XML_ONLY').count() > 0: + # only use the custom settings + pass + elif "poky" in template_conf: print("Loading poky configuration") call_command("loaddata", "poky") else: diff --git a/bitbake/lib/toaster/orm/management/commands/lsupdates.py b/bitbake/lib/toaster/orm/management/commands/lsupdates.py index 0b0d4ff..fac5733 100644 --- a/bitbake/lib/toaster/orm/management/commands/lsupdates.py +++ b/bitbake/lib/toaster/orm/management/commands/lsupdates.py @@ -81,6 +81,8 @@ class Command(BaseCommand): os.system('setterm -cursor off') self.apiurl = DEFAULT_LAYERINDEX_SERVER + if ToasterSetting.objects.filter(name='CUSTOM_LAYERINDEX_SERVER').count() == 1: + self.apiurl = ToasterSetting.objects.get(name = 'CUSTOM_LAYERINDEX_SERVER').value assert self.apiurl is not None try: @@ -92,7 +94,9 @@ class Command(BaseCommand): proxy_settings = os.environ.get("http_proxy", None) - def _get_json_response(apiurl=DEFAULT_LAYERINDEX_SERVER): + def _get_json_response(apiurl=None): + if None == apiurl: + apiurl=self.apiurl http_progress = Spinner() http_progress.start() -- 1.9.1