Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 43402E00DD0; Tue, 5 Jul 2016 08:40: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,DKIM_SIGNED, DKIM_VALID,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.192.171 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Received: from mail-pf0-f171.google.com (mail-pf0-f171.google.com [209.85.192.171]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 62A59E00D8F for ; Tue, 5 Jul 2016 08:40:25 -0700 (PDT) Received: by mail-pf0-f171.google.com with SMTP id i123so71132300pfg.0 for ; Tue, 05 Jul 2016 08:40:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=g0+JGl/eA8wuhWpxfjqJLBo9ixCgx98vHwnDmQjAPus=; b=0mjmA3NuwKz+IAFZy75StcTq8wrw/EoYdIrfpRFX8YYfCOtVZ1PDjiUDjrFN/bmzLK tbixz5zcya0mMNGp50dz9RdDKE8JsN1iGU6V+2SvwQ+Ijs2jDT1c974gmUPD2L7NwFQY Fg0l8Wot/9XjCJKrGa2DkABAre2wuaMFtgtkSdksUl5E2QvzowN5oQJa6rBb0OYLOxs6 a3o4uygv5AQ7XRzOZEeJxJHtGRQWET7EFdfkZFz7Z8S/152OJQJFHKukec16MAznxJ7z GJBrnU+51dTsc9WtJrv1lZNG+DD4ytvNr3FyeIBXxj1He/GR9dyjJ+G/46sQYF0ZRxRz AhoQ== 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:in-reply-to :references; bh=g0+JGl/eA8wuhWpxfjqJLBo9ixCgx98vHwnDmQjAPus=; b=JMf2CL04/Bz5QBkyjfNyBFin2pr8nAjM7O16Uc4nYm49cAfcOZmP9ii+AjVGJuVxDk tPhb81fzSTT2wE6rZ5FtQ0Xoiu1KuCcNwWSnAJNnVyKtGECc92/bBCDUp8BpIrrh3NUK LkWjeG0HVCcP/jcTXFzpDVU28WoaM7h33hw/ZAJIuONOUJKV3g2orh+WnfyGDKbAw2ni KFxuYQsHXmrOQxh+1ez+owRDFkURsAxRea9ddzdQzyiykStIy5uGUE+kZg8M7HFIr6bz tE6iWXyNpKTQ9hiisFFDUCoNDPen6xjNKeGbSTyfn2y4tEd6SZcD82VVomD9RebuuRoM FxJA== X-Gm-Message-State: ALyK8tK9GNqKAyGh35fRd3dZLpprmkBh0HhJH2D8elghQ2BRSSTtRmSrsw/KvPvs7CnaCIpV X-Received: by 10.98.91.196 with SMTP id p187mr33955179pfb.135.1467733225458; Tue, 05 Jul 2016 08:40:25 -0700 (PDT) Received: from orion.ger.corp.intel.com ([192.55.54.45]) by smtp.gmail.com with ESMTPSA id 203sm5961896pfz.35.2016.07.05.08.40.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Jul 2016 08:40:24 -0700 (PDT) From: Michael Wood To: toaster@yoctoproject.org Date: Tue, 5 Jul 2016 16:40:09 +0100 Message-Id: <1467733217-3185-2-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1467733217-3185-1-git-send-email-michael.g.wood@intel.com> References: <1467733217-3185-1-git-send-email-michael.g.wood@intel.com> Subject: [PATCH 1/9] toaster: loadconf remove Loading LayerSources 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: Tue, 05 Jul 2016 15:40:28 -0000 We don't need to configure layer sources in the initial configuration as this information is provided by the models. Signed-off-by: Michael Wood --- .../bldcontrol/management/commands/loadconf.py | 69 +--------------------- 1 file changed, 2 insertions(+), 67 deletions(-) diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py b/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py index 173e3ce..6f08f1d 100644 --- a/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py +++ b/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py @@ -1,6 +1,6 @@ from django.core.management.base import BaseCommand, CommandError from orm.models import LayerSource, ToasterSetting, Branch, Layer, Layer_Version -from orm.models import BitbakeVersion, Release, ReleaseDefaultLayer, ReleaseLayerSourcePriority +from orm.models import BitbakeVersion, Release, ReleaseDefaultLayer from django.db import IntegrityError import os @@ -42,7 +42,7 @@ class Command(BaseCommand): data = json.loads(open(filepath, "r").read()) # verify config file validity before updating settings - for i in ['bitbake', 'releases', 'defaultrelease', 'config', 'layersources']: + for i in ['bitbake', 'releases', 'defaultrelease', 'config']: assert i in data def _read_git_url_from_local_repository(address): @@ -81,65 +81,6 @@ class Command(BaseCommand): bvo.dirpath = bvi['dirpath'] bvo.save() - # set the layer sources - for lsi in data['layersources']: - assert 'sourcetype' in lsi - assert 'apiurl' in lsi - assert 'name' in lsi - assert 'branches' in lsi - - - if _get_id_for_sourcetype(lsi['sourcetype']) == LayerSource.TYPE_LAYERINDEX or lsi['apiurl'].startswith("/"): - apiurl = lsi['apiurl'] - else: - apiurl = _reduce_canon_path(os.path.join(DN(os.path.abspath(filepath)), lsi['apiurl'])) - - assert ((_get_id_for_sourcetype(lsi['sourcetype']) == LayerSource.TYPE_LAYERINDEX) or apiurl.startswith("/")), (lsi['sourcetype'],apiurl) - - try: - ls, created = LayerSource.objects.get_or_create(sourcetype = _get_id_for_sourcetype(lsi['sourcetype']), apiurl = apiurl) - ls.name = lsi['name'] - ls.save() - except IntegrityError as e: - logger.warning("IntegrityError %s \nWhile setting name %s for layer source %s " % (e, lsi['name'], ls)) - - - layerbranches = [] - for branchname in lsi['branches']: - bo, created = Branch.objects.get_or_create(layer_source = ls, name = branchname) - layerbranches.append(bo) - - if 'layers' in lsi: - for layerinfo in lsi['layers']: - lo, created = Layer.objects.get_or_create(layer_source = ls, name = layerinfo['name']) - if layerinfo['local_path'].startswith("/"): - lo.local_path = layerinfo['local_path'] - else: - lo.local_path = _reduce_canon_path(os.path.join(ls.apiurl, layerinfo['local_path'])) - - if not os.path.exists(lo.local_path): - logger.error("Local layer path %s must exists. Are you trying to import a layer that does not exist ? Check your local toasterconf.json" % lo.local_path) - - if layerinfo['vcs_url'].startswith("remote:"): - lo.vcs_url = _read_git_url_from_local_repository(layerinfo['vcs_url']) - if lo.vcs_url is None: - logger.error("The toaster config file references the local git repo, but Toaster cannot detect it.\nYour local configuration for layer %s is invalid. Make sure that the toasterconf.json file is correct." % layerinfo['name']) - - if lo.vcs_url is None: - lo.vcs_url = layerinfo['vcs_url'] - - if 'layer_index_url' in layerinfo: - lo.layer_index_url = layerinfo['layer_index_url'] - lo.save() - - for branch in layerbranches: - lvo, created = Layer_Version.objects.get_or_create(layer_source = ls, - up_branch = branch, - commit = branch.name, - layer = lo) - lvo.dirpath = layerinfo['dirpath'] - lvo.save() - # set releases for ri in data['releases']: bvo = BitbakeVersion.objects.get(name = ri['bitbake']) assert bvo is not None @@ -149,12 +90,6 @@ class Command(BaseCommand): ro.helptext = ri['helptext'] ro.save() - # save layer source priority for release - for ls_name in ri['layersourcepriority'].keys(): - rlspo, created = ReleaseLayerSourcePriority.objects.get_or_create(release = ro, layer_source = LayerSource.objects.get(name=ls_name)) - rlspo.priority = ri['layersourcepriority'][ls_name] - rlspo.save() - for dli in ri['defaultlayers']: # find layers with the same name ReleaseDefaultLayer.objects.get_or_create( release = ro, layer_name = dli) -- 2.7.4