diff options
Diffstat (limited to 'bitbake/lib/toaster/orm/management/commands/lsupdates.py')
-rw-r--r-- | bitbake/lib/toaster/orm/management/commands/lsupdates.py | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/bitbake/lib/toaster/orm/management/commands/lsupdates.py b/bitbake/lib/toaster/orm/management/commands/lsupdates.py index 66114ff89e..6d64830ebd 100644 --- a/bitbake/lib/toaster/orm/management/commands/lsupdates.py +++ b/bitbake/lib/toaster/orm/management/commands/lsupdates.py @@ -1,27 +1,14 @@ # -# ex:ts=4:sw=4:sts=4:et -# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- -# # BitBake Toaster Implementation # # Copyright (C) 2016-2017 Intel Corporation # -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# SPDX-License-Identifier: GPL-2.0-only # -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. from django.core.management.base import BaseCommand -from orm.models import LayerSource, Layer, Release, Layer_Version +from orm.models import Layer, Release, Layer_Version from orm.models import LayerVersionDependency, Machine, Recipe from orm.models import Distro from orm.models import ToasterSetting @@ -34,7 +21,7 @@ import threading import time logger = logging.getLogger("toaster") -DEFAULT_LAYERINDEX_SERVER = "http://layers.openembedded.org/layerindex/api/" +DEFAULT_LAYERINDEX_SERVER = "https://layers.openembedded.org/layerindex/api/" # Add path to bitbake modules for layerindexlib # lib/toaster/orm/management/commands/lsupdates.py (abspath) @@ -53,7 +40,7 @@ class Spinner(threading.Thread): """ A simple progress spinner to indicate download/parsing is happening""" def __init__(self, *args, **kwargs): super(Spinner, self).__init__(*args, **kwargs) - self.setDaemon(True) + self.daemon = True self.signal = True def run(self): @@ -81,7 +68,7 @@ class Command(BaseCommand): (what, pec)) sys.stdout.flush() - if int(pec) is 100: + if int(pec) == 100: sys.stdout.write("\n") sys.stdout.flush() @@ -100,13 +87,13 @@ class Command(BaseCommand): # update branches; only those that we already have names listed in the # Releases table - whitelist_branch_names = [rel.branch_name - for rel in Release.objects.all()] - if len(whitelist_branch_names) == 0: + allowed_branch_names = [rel.branch_name + for rel in Release.objects.all()] + if len(allowed_branch_names) == 0: raise Exception("Failed to make list of branches to fetch") logger.info("Fetching metadata for %s", - " ".join(whitelist_branch_names)) + " ".join(allowed_branch_names)) # We require a non-empty bb.data, but we can fake it with a dictionary layerindex = layerindexlib.LayerIndex({"DUMMY" : "VALUE"}) @@ -114,8 +101,8 @@ class Command(BaseCommand): http_progress = Spinner() http_progress.start() - if whitelist_branch_names: - url_branches = ";branch=%s" % ','.join(whitelist_branch_names) + if allowed_branch_names: + url_branches = ";branch=%s" % ','.join(allowed_branch_names) else: url_branches = "" layerindex.load_layerindex("%s%s" % (self.apiurl, url_branches)) |