diff options
author | David Reyna <David.Reyna@windriver.com> | 2017-06-27 13:44:30 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-27 22:17:53 +0100 |
commit | a156a4eff67cdc3943494f5be72b96e3db656250 (patch) | |
tree | ae8b5ced5924a153df26431aa931e34f443e8ad6 /lib/toaster/orm/management | |
parent | 0c94d947b74c4dee23d7b9d255facd3cf839ccbe (diff) | |
download | bitbake-contrib-a156a4eff67cdc3943494f5be72b96e3db656250.tar.gz |
toaster: Add distro selection support
Add the ability to select a distro in the project page,
based on values from the Layer Index. Add a distro selection
page with the add layer feature, based on the add machine
page.
[YOCTO #10632]
Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/toaster/orm/management')
-rw-r--r-- | lib/toaster/orm/management/commands/lsupdates.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/toaster/orm/management/commands/lsupdates.py b/lib/toaster/orm/management/commands/lsupdates.py index 90f07c9dc..0b0d4ff8f 100644 --- a/lib/toaster/orm/management/commands/lsupdates.py +++ b/lib/toaster/orm/management/commands/lsupdates.py @@ -23,6 +23,7 @@ from django.core.management.base import BaseCommand from orm.models import LayerSource, Layer, Release, Layer_Version from orm.models import LayerVersionDependency, Machine, Recipe +from orm.models import Distro import os import sys @@ -249,6 +250,24 @@ class Command(BaseCommand): depends_on=lvd) self.mini_progress("Layer version dependencies", i, total) + # update Distros + logger.info("Fetching distro information") + distros_info = _get_json_response( + apilinks['distros'] + "?filter=layerbranch__branch__name:%s" % + "OR".join(whitelist_branch_names)) + + total = len(distros_info) + for i, di in enumerate(distros_info): + distro, created = Distro.objects.get_or_create( + name=di['name'], + layer_version=Layer_Version.objects.get( + pk=li_layer_branch_id_to_toaster_lv_id[di['layerbranch']])) + distro.up_date = di['updated'] + distro.name = di['name'] + distro.description = di['description'] + distro.save() + self.mini_progress("distros", i, total) + # update machines logger.info("Fetching machine information") machines_info = _get_json_response( |