summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/lib/Client/Tools/rpmtools.py14
-rwxr-xr-xsrc/lib/Server/Admin/Reports.py5
-rw-r--r--src/lib/Server/Plugins/Packages.py6
3 files changed, 14 insertions, 11 deletions
diff --git a/src/lib/Client/Tools/rpmtools.py b/src/lib/Client/Tools/rpmtools.py
index c9385196f..e224a3fb3 100755
--- a/src/lib/Client/Tools/rpmtools.py
+++ b/src/lib/Client/Tools/rpmtools.py
@@ -21,19 +21,19 @@
__revision__ = '$Revision$'
import grp
-try:
- import hashlib
- py24compat = False
-except:
- # FIXME: Remove when client python dep is 2.5 or greater
- py24compat = True
- import md5
import optparse
import os
import pwd
import rpm
import stat
import sys
+if sys.version_info >= (2, 5):
+ import hashlib
+ py24compat = False
+else:
+ # FIXME: Remove when client python dep is 2.5 or greater
+ py24compat = True
+ import md5
# Determine what prelink tools we have available.
# The isprelink module is a python extension that examines the ELF headers
diff --git a/src/lib/Server/Admin/Reports.py b/src/lib/Server/Admin/Reports.py
index d11451852..91d25a0b0 100755
--- a/src/lib/Server/Admin/Reports.py
+++ b/src/lib/Server/Admin/Reports.py
@@ -12,9 +12,10 @@ from Bcfg2.Server.Reports.updatefix import update_database
from Bcfg2.Server.Reports.utils import *
from lxml.etree import XML, XMLSyntaxError
-try:
+# FIXME: Remove when server python dep is 2.5 or greater
+if sys.version_info >= (2, 5)::
from hashlib import md5
-except ImportError:
+else:
from md5 import md5
# Load django
diff --git a/src/lib/Server/Plugins/Packages.py b/src/lib/Server/Plugins/Packages.py
index d2517590c..61d6e1778 100644
--- a/src/lib/Server/Plugins/Packages.py
+++ b/src/lib/Server/Plugins/Packages.py
@@ -6,11 +6,13 @@ import logging
import lxml.etree
import os
import re
+import sys
import urllib2
-try:
+# FIXME: Remove when server python dep is 2.5 or greater
+if sys.version_info >= (2, 5)::
from hashlib import md5
-except ImportError:
+else:
from md5 import md5
import Bcfg2.Logger