diff options
author | Gui Chen <gui.chen@intel.com> | 2012-12-09 15:30:30 +0800 |
---|---|---|
committer | Gui Chen <gui.chen@intel.com> | 2012-12-12 19:33:45 +0800 |
commit | 31395f3af9476f45de068ee0d3bdd3ff033004a5 (patch) | |
tree | 7926f55b4457ee21a3ea6faf4432c84d2b23f05d /plugins | |
parent | 75c6587a7d6e642f6f97a558555319eee00ee501 (diff) | |
download | mic-31395f3af9476f45de068ee0d3bdd3ff033004a5.tar.gz mic-31395f3af9476f45de068ee0d3bdd3ff033004a5.tar.bz2 mic-31395f3af9476f45de068ee0d3bdd3ff033004a5.zip |
require python-m2crypto when needed sslverify
Signed-off-by: Gui Chen <gui.chen@intel.com>
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/backend/yumpkgmgr.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/backend/yumpkgmgr.py b/plugins/backend/yumpkgmgr.py index 90f9c77..33e354e 100644 --- a/plugins/backend/yumpkgmgr.py +++ b/plugins/backend/yumpkgmgr.py @@ -68,9 +68,12 @@ class MyYumRepository(yum.yumRepo.YumRepository): m2c_connection = None if not self.sslverify: - import M2Crypto - m2c_connection = M2Crypto.SSL.Connection.clientPostConnectionCheck - M2Crypto.SSL.Connection.clientPostConnectionCheck = None + try: + import M2Crypto + m2c_connection = M2Crypto.SSL.Connection.clientPostConnectionCheck + M2Crypto.SSL.Connection.clientPostConnectionCheck = None + except ImportError, err: + raise CreatorError("%s, please try to install python-m2crypto" % str(err)) proxy = None if url: |