summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/orm
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2015-08-18 17:28:50 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-19 18:05:52 +0100
commit504396f6a35e1a18d852f2387098ba7f8f298d3d (patch)
treed7a1a6624ffd18c407317e53bcf64e7ae3019380 /bitbake/lib/toaster/orm
parent99730d64d4b83ce37d4b3f5a7f992512fd12cbf7 (diff)
downloadpoky-504396f6a35e1a18d852f2387098ba7f8f298d3d.tar.gz
bitbake: toaster: improve exception handling
This patch improves exception handling, fixing issues as prompted by pylint, including exception renaming. (Bitbake rev: 652fad64864703cb1bbeede8d5bfc4208974be68) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/orm')
-rw-r--r--bitbake/lib/toaster/orm/models.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index b3f8db9750..6b485d2ac4 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -269,11 +269,10 @@ class Project(models.Model):
269 except ProjectVariable.DoesNotExist: 269 except ProjectVariable.DoesNotExist:
270 pass 270 pass
271 br.save() 271 br.save()
272 except Exception as e: 272 except Exception:
273 # revert the build request creation since we're not done cleanly
273 br.delete() 274 br.delete()
274 import sys 275 raise
275 et, ei, tb = sys.exc_info()
276 raise type(e), e, tb
277 return br 276 return br
278 277
279class Build(models.Model): 278class Build(models.Model):
@@ -364,7 +363,7 @@ class BuildArtifact(models.Model):
364 363
365 364
366 def is_available(self): 365 def is_available(self):
367 return build.buildrequest.environment.has_artifact(file_path) 366 return self.build.buildrequest.environment.has_artifact(self.file_name)
368 367
369class ProjectTarget(models.Model): 368class ProjectTarget(models.Model):
370 project = models.ForeignKey(Project) 369 project = models.ForeignKey(Project)
@@ -981,12 +980,10 @@ class LayerIndexLayerSource(LayerSource):
981 if 'inherits' in ri: 980 if 'inherits' in ri:
982 ro.is_image = 'image' in ri['inherits'].split() 981 ro.is_image = 'image' in ri['inherits'].split()
983 ro.save() 982 ro.save()
984 except: 983 except Exception:
985 #print "Duplicate Recipe, ignoring: ", vars(ro) 984 logger.warning("Duplicate Recipe, ignoring: %s " % vars(ro))
986 pass
987 if not connection.features.autocommits_when_autocommit_is_off: 985 if not connection.features.autocommits_when_autocommit_is_off:
988 transaction.set_autocommit(True) 986 transaction.set_autocommit(True)
989 pass
990 987
991class BitbakeVersion(models.Model): 988class BitbakeVersion(models.Model):
992 989