print GPG errors to log
[plcapi.git] / PLC / GPG.py
index 0101e47..4182f60 100644 (file)
@@ -7,7 +7,7 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2006 The Trustees of Princeton University
 #
-# $Id: GPG.py,v 1.1 2006/12/15 18:21:57 mlhuang Exp $
+# $Id: GPG.py,v 1.2 2007/01/05 18:50:40 mlhuang Exp $
 #
 
 import xmlrpclib
@@ -56,13 +56,14 @@ def gpg_sign(methodname, args, secret_keyring, keyring):
     p.stdin.write(message)
     p.stdin.close()
     signature = p.stdout.read()
+    err = p.stderr.read()
     rc = p.wait()
 
     # Clean up
     shutil.rmtree(homedir)
 
     if rc:
-        raise PLCAuthenticationFailure, "GPG signing failed with return code %d" % rc
+        raise PLCAuthenticationFailure, "GPG signing failed with return code %d: %s" % (rc, err)
 
     return signature