summaryrefslogtreecommitdiffstats
path: root/doctor_tests
diff options
context:
space:
mode:
authorTomi Juvonen <tomi.juvonen@nokia.com>2018-11-20 11:44:24 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-11-20 11:44:24 +0000
commit916e4931a56c1a5d41d46148609bf348d4326d37 (patch)
tree28758c15636fa46469314ecc13a9815c6f4512a0 /doctor_tests
parent4075b417e973adb257ae39ff5c25aa182a2af3ea (diff)
parent53416ca31633c9b9d1924f4ef35c70c045fa0101 (diff)
Merge "fix the configparser for Python 2 and 3 Compatibility"
Diffstat (limited to 'doctor_tests')
-rw-r--r--doctor_tests/installer/common/set_congress.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/doctor_tests/installer/common/set_congress.py b/doctor_tests/installer/common/set_congress.py
index d2754838..7961df32 100644
--- a/doctor_tests/installer/common/set_congress.py
+++ b/doctor_tests/installer/common/set_congress.py
@@ -6,7 +6,7 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-import configparser
+from six.moves import configparser
import os
import shutil
@@ -22,13 +22,13 @@ def set_drivers_config():
config = configparser.ConfigParser()
config.read(co_conf)
- drivers = config['DEFAULT']['drivers']
+ drivers = config.get('DEFAULT', 'drivers')
if doctor_driver not in drivers:
config_modified = True
drivers += ',' + doctor_driver
- config['DEFAULT']['drivers'] = drivers
+ config.set('DEFAULT', 'drivers', drivers)
if config_modified:
shutil.copyfile(co_conf, co_conf_bak)