summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/views.py
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2015-12-09 19:56:36 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-14 23:13:07 +0000
commitf001a4ac3cfd83405c85b62cf2509fab785bcf49 (patch)
tree3c52c589bf16235f9ed958330ef6ababd8250e20 /bitbake/lib/toaster/toastergui/views.py
parent0adffdf790e40ec865d790d137fab56aea674060 (diff)
downloadpoky-f001a4ac3cfd83405c85b62cf2509fab785bcf49.tar.gz
bitbake: toaster: Remove compatible_layerversions() method
Remove compatible_layerversions() and replace calls to it with calls to get_all_compatible_layer_versions(). The sorting done in compatible_layerversions() is not relevant, and the code can be simplified by using get_all_compatible_layer_versions(). [YOCTO #8364] (Bitbake rev: 7bca51277314f7c0b6ee0e0d470327dfd60d37fe) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py22
1 files changed, 14 insertions, 8 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 16f27b8022..bd334b9f80 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -2264,16 +2264,17 @@ if True:
2264 prj.bitbake_version = prj.release.bitbake_version 2264 prj.bitbake_version = prj.release.bitbake_version
2265 prj.save() 2265 prj.save()
2266 # we need to change the layers 2266 # we need to change the layers
2267 for i in prj.projectlayer_set.all(): 2267 for project in prj.projectlayer_set.all():
2268 # find and add a similarly-named layer on the new branch 2268 # find and add a similarly-named layer on the new branch
2269 try: 2269 try:
2270 lv = prj.compatible_layerversions(layer_name = i.layercommit.layer.name)[0] 2270 layer_versions = prj.get_all_compatible_layer_versions()
2271 ProjectLayer.objects.get_or_create(project = prj, layercommit = lv) 2271 layer_versions = layer_versions.filter(layer__name = project.layercommit.layer.name)
2272 ProjectLayer.objects.get_or_create(project = prj, layercommit = layer_versions.first())
2272 except IndexError: 2273 except IndexError:
2273 pass 2274 pass
2274 finally: 2275 finally:
2275 # get rid of the old entry 2276 # get rid of the old entry
2276 i.delete() 2277 project.delete()
2277 2278
2278 if 'machineName' in request.POST: 2279 if 'machineName' in request.POST:
2279 machinevar = prj.projectvariable_set.get(name="MACHINE") 2280 machinevar = prj.projectvariable_set.get(name="MACHINE")
@@ -2383,12 +2384,17 @@ if True:
2383 2384
2384 retval = [] 2385 retval = []
2385 2386
2386 for i in prj.projectlayer_set.all(): 2387 for project in prj.projectlayer_set.all():
2387 lv = prj.compatible_layerversions(release = Release.objects.get(pk=new_release_id)).filter(layer__name = i.layercommit.layer.name) 2388 release = Release.objects.get(pk = new_release_id)
2389
2390 layer_versions = prj.get_all_compatible_layer_versions()
2391 layer_versions = layer_versions.filter(release = release)
2392 layer_versions = layer_versions.filter(layer__name = project.layercommit.layer.name)
2393
2388 # there is no layer_version with the new release id, 2394 # there is no layer_version with the new release id,
2389 # and the same name 2395 # and the same name
2390 if lv.count() < 1: 2396 if layer_versions.count() < 1:
2391 retval.append(i) 2397 retval.append(project)
2392 2398
2393 return response({"error":"ok", 2399 return response({"error":"ok",
2394 "rows" : map( _lv_to_dict(prj), 2400 "rows" : map( _lv_to_dict(prj),