summaryrefslogtreecommitdiff
path: root/keymanager/src
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2015-07-23 14:34:53 -0400
committerKali Kaneko <kali@leap.se>2015-07-23 14:34:53 -0400
commit8589e947fbae5baf21caa8b47d75d7d33c2f493b (patch)
treefc10102097ae6e0130f3739298488178fbfdf7ba /keymanager/src
parentd700bf5774643b132d635ce744680ac3c3d7b2b4 (diff)
[pkg] avoid choking on latest gnupg version
latest gnupg version (from pypi) was '2.0.2-py2.7.egg', which is parsed as a LegacyVersion and therefore breaks the numeric comparison. this is a workaround to allow the sanity check to continue, by comparing just the numeric part of the version string.
Diffstat (limited to 'keymanager/src')
-rw-r--r--keymanager/src/leap/keymanager/__init__.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/keymanager/src/leap/keymanager/__init__.py b/keymanager/src/leap/keymanager/__init__.py
index c2d74096..56633c5d 100644
--- a/keymanager/src/leap/keymanager/__init__.py
+++ b/keymanager/src/leap/keymanager/__init__.py
@@ -24,13 +24,20 @@ try:
from gnupg.gnupg import GPGUtilities
assert(GPGUtilities) # pyflakes happy
from gnupg import __version__ as _gnupg_version
+ if '-' in _gnupg_version:
+ # avoid Parsing it as LegacyVersion, get just
+ # the release numbers:
+ _gnupg_version = _gnupg_version.split('-')[0]
from pkg_resources import parse_version
+ # We need to make sure that we're not colliding with the infamous
+ # python-gnupg
assert(parse_version(_gnupg_version) >= parse_version('1.4.0'))
except (ImportError, AssertionError):
print "*******"
print "Ooops! It looks like there is a conflict in the installed version "
print "of gnupg."
+ print "GNUPG_VERSION:", _gnupg_version
print
print "Disclaimer: Ideally, we would need to work a patch and propose the "
print "merge to upstream. But until then do: "