Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 9F2BEE00E51; Thu, 7 Jul 2016 10:22:05 -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 * [74.125.82.47 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-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id E9A30E00E44 for ; Thu, 7 Jul 2016 10:22:01 -0700 (PDT) Received: by mail-wm0-f47.google.com with SMTP id f126so219043204wma.1 for ; Thu, 07 Jul 2016 10:22:01 -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=sS8vckDhgtCDjffpRH0SHm/om6JC77fLL2FoA/DH+S5QXo4x4VucI+lhV7tkwkN/Qn tNgM1kFZeBqvS/KTBpm0UFu34egW+K73vgsYmsW04V1nTYtoJO78QbCtj7jDo1sLf4r9 uRaO7cDhE/qYZ98dOsDsxySHZAqmLFbMT9AVKOSgAXdFKm88Wsp+mxX7W+Fn1fZFMTE3 MVC5yEwjUfkK0idqZmfISSTJiHcJaIQgeelu3n3w0GI6xtZV6KQa944WRyEx2RT+Drue 1ZrTkV/7pWbb8bFuMveKm5ohoDFWbsrXTnzl2//IjKQMSJXO76jBYTpTx3RFnJ2sQ/oh uDtw== 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=lYayqMMm5U6jkBYF2I9i1ypuVIcnEOOZb6FMxo7JELp/ShATftM20AgXMzIPDbcF9v T/BBN+EFIpakP3fzu8oja5QDZfRX6OU8b33TFgo6lh4Xm+Zg1LMMDileNh174leUi0fi e2QUoLIbL0CkwzeGo07EJ9cs7YhKuQ9rFt4jy97U5SfCieczfH7w930tNQGdqSbiaYkZ ZJdXWEShs5mHz+rM1ECfdegCaZs03Rs2Z15piagrJ5C6O5qyili+RVsQzkj4BGzCEtji hjJvklW6Hu5irjWQzCYbIZGiZphOex7VdWhe4h3EGcJ9mlKlxPFxgj+rJHPOdbVwaKI4 4f7g== X-Gm-Message-State: ALyK8tJEOnIZrfb5y0OtZX3tmfTQLiqoXNwtItEW7U4IUWw28hY+adHx/CRYpBk0SWrGB4fe X-Received: by 10.194.234.103 with SMTP id ud7mr1187971wjc.39.1467912121025; Thu, 07 Jul 2016 10:22:01 -0700 (PDT) Received: from localhost.localdomain (host86-169-85-169.range86-169.btcentralplus.com. [86.169.85.169]) by smtp.gmail.com with ESMTPSA id e69sm2059408wma.2.2016.07.07.10.21.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Jul 2016 10:22:00 -0700 (PDT) From: Michael Wood To: toaster@yoctoproject.org Date: Thu, 7 Jul 2016 18:21:40 +0100 Message-Id: <1467912108-24659-2-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1467912108-24659-1-git-send-email-michael.g.wood@intel.com> References: <1467912108-24659-1-git-send-email-michael.g.wood@intel.com> Subject: [PATCH v2 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: Thu, 07 Jul 2016 17:22:05 -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