aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis Bouchard <louis@ubuntu.com>2017-11-08 14:15:36 +0100
committerBryn M. Reeves <bmr@redhat.com>2017-11-15 15:32:52 +0000
commit0b30e8f72c3c669455209d15b1eb01de20c7d578 (patch)
treeb3478f92fe7920ae67d5db3492e452190d51df77
parent2f51f6b7478e69d8f9e8e3a31bddccf6af88c720 (diff)
downloadsos-0b30e8f72c3c669455209d15b1eb01de20c7d578.tar.gz
[haproxy] Fix py2 specific import syntax for urlparse
urlparse is now part of urllib in python3. Make sure that the proxy behaves correctly on both versions. Closes: #1137 Signed-off-by: Louis Bouchard <louis@ubuntu.com> Fixes: #1138 Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/haproxy.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/sos/plugins/haproxy.py b/sos/plugins/haproxy.py
index 390b6ddb..eb696c9f 100644
--- a/sos/plugins/haproxy.py
+++ b/sos/plugins/haproxy.py
@@ -15,9 +15,13 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from sos.plugins import Plugin, RedHatPlugin, DebianPlugin
-from urlparse import urlparse
from re import match
+try:
+ from urllib.parse import urlparse
+except ImportError:
+ from urlparse import urlparse
+
class HAProxy(Plugin, RedHatPlugin, DebianPlugin):
"""HAProxy load balancer