reguire gnupg1 on f>=31; sense the system to use gpg1 when installed
[nodemanager.git] / ticket.py
index 0012908..a52be17 100644 (file)
--- a/ticket.py
+++ b/ticket.py
@@ -1,6 +1,3 @@
-# $Id$
-# $URL$
-
 """An extremely simple interface to the signing/verifying capabilities
 of gnupg.
 
@@ -8,9 +5,11 @@ You must already have the key in the keyring.
 """
 
 from subprocess import PIPE, Popen
-from xmlrpclib import dumps, loads
+from xmlrpc.client import dumps, loads
 
-GPG = '/usr/bin/gpg'
+# see also myplc/plc.d/gpg
+import os.path
+GPG = '/usr/bin/gpg1' if os.path.exists("/usr/bin/gpg1") else "/usr/bin/gpg"
 
 def _popen_gpg(*args):
     """Return a Popen object to GPG."""