diff options
author | Tomás Touceda <chiiph@torproject.org> | 2011-11-05 14:54:57 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@torproject.org> | 2011-11-05 14:54:57 -0300 |
commit | d2f814426fc5bae6315daea3feb8a3f8a2a9efd5 (patch) | |
tree | c74db86fadcf3085e43af6bfc798a7dd377e26aa /lib/thandy/packagesys/ThpPackages.py | |
parent | 3e752ddc9435831c5d74181e070ec8c5ba1b714e (diff) |
Add logCtrl for scripts that might fail from a thp
Diffstat (limited to 'lib/thandy/packagesys/ThpPackages.py')
-rw-r--r-- | lib/thandy/packagesys/ThpPackages.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/thandy/packagesys/ThpPackages.py b/lib/thandy/packagesys/ThpPackages.py index f82415e..4745767 100644 --- a/lib/thandy/packagesys/ThpPackages.py +++ b/lib/thandy/packagesys/ThpPackages.py @@ -16,6 +16,8 @@ import thandy.formats import thandy.packagesys.PackageSystem as PS import thandy.packagesys.PackageDB as PDB +from thandy.util import logCtrl + json = thandy.util.importJSON() class ThpDB(object): @@ -184,15 +186,18 @@ class ThpTransaction(PS.Transaction): for pkg in order: if pkg.run('checkinst') != 0: logging.info("Check inst failed for %s" % pkg) + logCtrl("ERROR", SCRIPT="checkinst") sys.exit(1) for pkg in order: logging.info("Starting installation using %s" % pkg) if pkg.run('preinst') != 0: logging.info("Preinst script for %s failed" % pkg) + logCtrl("ERROR", SCRIPT="preinst") sys.exit(1) pkg.install() if pkg.run('postinst') != 0: logging.info("postinst script failed") + logCtrl("ERROR", SCRIPT="postinst") except AlreadyLocked: print "You can't run more than one instance of Thandy" except LockFailed: |