[yocto] [PATCH 09/11][auh] upgradehelper.py: Change policy for send emails and fix error passing
Aníbal Limón
anibal.limon at linux.intel.com
Wed Jun 10 09:28:50 PDT 2015
Now send emails almost in all cases this give the maintainer
patches and diff to continue work also if the build isn't
succesful.
[YOCTO #7489]
Signed-off-by: Aníbal Limón <anibal.limon at linux.intel.com>
---
upgradehelper.py | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/upgradehelper.py b/upgradehelper.py
index b1f075d..a4aa0ab 100755
--- a/upgradehelper.py
+++ b/upgradehelper.py
@@ -381,8 +381,11 @@ class Updater(object):
"Attached are the patch, license diff (if change) and bitbake log.\n\n" \
"Regards,\nThe Upgrade Helper"
- # don't bother maintainer with mail if the recipe is already up to date
- if status == "UpgradeNotNeededError":
+ if status == "Error" or status == "FetchError" or\
+ status == "UpgradeNotNeededError":
+ D( "%s: Don't send email to maintainer because the error was " \
+ "%s and the information isn't useful, please review it." \
+ % (self.pn, status))
return
if self.maintainer in maintainer_override:
@@ -478,6 +481,7 @@ class Updater(object):
attempted_pkgs = 0
for self.pn, self.new_ver, self.maintainer in pkgs_to_upgrade:
+ error = None
self.recipe = None
attempted_pkgs += 1
I(" ATTEMPT PACKAGE %d/%d" % (attempted_pkgs, total_pkgs))
@@ -489,12 +493,9 @@ class Updater(object):
step()
I(" %s: Upgrade SUCCESSFUL! Please test!" % self.pn)
- error = None
- except UpgradeNotNeededError as e:
- I(" %s: %s" % (self.pn, e.message))
- error = e
- except Error as e:
- E(" %s: %s" % (self.pn, e.message))
+ except Exception as e:
+ if isinstance(e, Error):
+ E(" %s: %s" % (self.pn, e.message))
E(" %s: Upgrade FAILED! Logs and/or file diffs are available in %s" % (self.pn, self.workdir))
error = e
@@ -667,7 +668,7 @@ class UniverseUpdater(Updater):
# overriding the base method
def pkg_upgrade_handler(self, err):
- super(UniverseUpdater, self).pkg_upgrade_handler(self)
+ super(UniverseUpdater, self).pkg_upgrade_handler(err)
self.update_history(self.pn, self.new_ver, self.maintainer,
self._get_status_msg(err))
--
1.8.4.5
More information about the yocto
mailing list