mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 12:19:02 +02:00
RRS: use more robust method of getting last upgrade record
Silently catching all exceptions like this is evil. Use .first() and check the return instead. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
928d19a9ab
commit
6344724afd
|
@ -160,13 +160,10 @@ def _create_upgrade(recipe_data, layerbranch, ct, title, info, filepath, logger,
|
|||
summary = recipe_data.getVar('SUMMARY', True) or recipe_data.getVar('DESCRIPTION', True)
|
||||
recipesymbol = RecipeSymbol.symbol(recipe_data.getVar('PN', True), layerbranch, summary=summary)
|
||||
|
||||
try:
|
||||
latest_upgrade = RecipeUpgrade.objects.filter(
|
||||
recipesymbol=recipesymbol).order_by('-commit_date')[0]
|
||||
latest_upgrade = RecipeUpgrade.objects.filter(recipesymbol=recipesymbol).order_by('-commit_date').first()
|
||||
if latest_upgrade:
|
||||
prev_pv = latest_upgrade.version
|
||||
except KeyboardInterrupt:
|
||||
raise
|
||||
except:
|
||||
else:
|
||||
prev_pv = None
|
||||
|
||||
if prev_pv is None:
|
||||
|
|
Loading…
Reference in New Issue
Block a user