mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 13:09:50 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
99730d64d4
commit
504396f6a3
@@ -269,11 +269,10 @@ class Project(models.Model):
|
||||
except ProjectVariable.DoesNotExist:
|
||||
pass
|
||||
br.save()
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
# revert the build request creation since we're not done cleanly
|
||||
br.delete()
|
||||
import sys
|
||||
et, ei, tb = sys.exc_info()
|
||||
raise type(e), e, tb
|
||||
raise
|
||||
return br
|
||||
|
||||
class Build(models.Model):
|
||||
@@ -364,7 +363,7 @@ class BuildArtifact(models.Model):
|
||||
|
||||
|
||||
def is_available(self):
|
||||
return build.buildrequest.environment.has_artifact(file_path)
|
||||
return self.build.buildrequest.environment.has_artifact(self.file_name)
|
||||
|
||||
class ProjectTarget(models.Model):
|
||||
project = models.ForeignKey(Project)
|
||||
@@ -981,12 +980,10 @@ class LayerIndexLayerSource(LayerSource):
|
||||
if 'inherits' in ri:
|
||||
ro.is_image = 'image' in ri['inherits'].split()
|
||||
ro.save()
|
||||
except:
|
||||
#print "Duplicate Recipe, ignoring: ", vars(ro)
|
||||
pass
|
||||
except Exception:
|
||||
logger.warning("Duplicate Recipe, ignoring: %s " % vars(ro))
|
||||
if not connection.features.autocommits_when_autocommit_is_off:
|
||||
transaction.set_autocommit(True)
|
||||
pass
|
||||
|
||||
class BitbakeVersion(models.Model):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user