From a9b51f2d1fd3a8be6496b62b989b6838b542936b Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Fri, 1 Feb 2019 12:24:14 +0530 Subject: geo-rep: Fix configparser import issue 'configparser' is backported to python2 and can be installed using pip (pip install configparser). So trying to import 'configparser' first and later 'ConfigParser' can cause issues w.r.t unicode strings. Always try importing 'ConfigParser' first and then 'configparser'. This solves python2/python3 compat issues. Change-Id: I2a87c3fc46476296b8cb547338f35723518751cc fixes: bz#1671637 Signed-off-by: Kotresh HR --- geo-replication/syncdaemon/gsyncdconfig.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/geo-replication/syncdaemon/gsyncdconfig.py b/geo-replication/syncdaemon/gsyncdconfig.py index 5d439a4c5ee..23a1c5769c7 100644 --- a/geo-replication/syncdaemon/gsyncdconfig.py +++ b/geo-replication/syncdaemon/gsyncdconfig.py @@ -10,9 +10,9 @@ # try: - from configparser import ConfigParser, NoSectionError -except ImportError: from ConfigParser import ConfigParser, NoSectionError +except ImportError: + from configparser import ConfigParser, NoSectionError import os from string import Template from datetime import datetime -- cgit