Merge "Use ConfigParser instead of SafeConfigParser in Python 3"

This commit is contained in:
Jenkins 2016-09-21 17:21:04 +00:00 committed by Gerrit Code Review
commit 229824c2ca

View File

@ -14,6 +14,7 @@
import os
import six
import six.moves.configparser as config_parser
from tempest.lib.cli import base
from tempest.lib.common.utils import data_utils
@ -58,6 +59,10 @@ class FunctionalTestBase(base.ClientTestBase):
def _get_config(self):
config_file = os.environ.get('IRONICCLIENT_TEST_CONFIG',
DEFAULT_CONFIG_FILE)
# SafeConfigParser was deprecated in Python 3.2
if six.PY3:
config = config_parser.ConfigParser()
else:
config = config_parser.SafeConfigParser()
if not config.read(config_file):
self.skipTest('Skipping, no test config found @ %s' % config_file)