diff options
author | drebs <drebs@leap.se> | 2013-10-02 14:13:23 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2013-10-02 14:13:23 -0300 |
commit | 4fabbf0cb2e7fc0b3dc7c00ddbd6a3a87fc4b654 (patch) | |
tree | dc42a47cdc6c8b80136a115c11889b9e3d1f291c /keymanager | |
parent | 58acd4a2fb6bd28611e7b736dc2b63b30cfeb2e8 (diff) | |
parent | 5e5af82141b6740067432bfc24750ffd2e0c98a3 (diff) |
Merge remote-tracking branch 'remotes/kalikaneko/bug/enforce-correct-version' into develop
Diffstat (limited to 'keymanager')
-rw-r--r-- | keymanager/changes/bug_enforce_correct_version | 1 | ||||
-rw-r--r-- | keymanager/src/leap/keymanager/__init__.py | 21 |
2 files changed, 20 insertions, 2 deletions
diff --git a/keymanager/changes/bug_enforce_correct_version b/keymanager/changes/bug_enforce_correct_version new file mode 100644 index 00000000..eb03e418 --- /dev/null +++ b/keymanager/changes/bug_enforce_correct_version @@ -0,0 +1 @@ + o Add a sanity check for the correct version of gnupg. diff --git a/keymanager/src/leap/keymanager/__init__.py b/keymanager/src/leap/keymanager/__init__.py index 2f39ad9e..76be2262 100644 --- a/keymanager/src/leap/keymanager/__init__.py +++ b/keymanager/src/leap/keymanager/__init__.py @@ -14,11 +14,28 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. - - """ Key Manager is a Nicknym agent for LEAP client. """ +# let's do a little sanity check to see if we're using the wrong gnupg +import sys + +try: + from gnupg.gnupg import GPGUtilities + assert(GPGUtilities) # pyflakes happy + from gnupg import __version__ + from distutils.version import LooseVersion as V + assert(V(__version__) >= V('1.2.2')) + +except ImportError, AssertionError: + print "Ooops! It looks like there is a conflict in the installed version " + print "of gnupg." + print "Disclaimer: Ideally, we would need to work a patch and propose the " + print "merge to upstream. But until then do: " + print + print "% pip uninstall python-gnupg" + print "% pip install gnupg" + sys.exit(1) import logging import requests |