Use ConfigParser instead of SafeConfigParser in Python 3
The SafeConfigParser class has been renamed to ConfigParser in Python 3.2 [1]. The alias SafeConfigParser maybe removed in future versions of Python 3. Use ConfigParser instead of SafeConfigParser in Python 3 [1] http://bugs.python.org/issue10627 Change-Id: I7b550cbd7b5d4c4fe3511c456b5f738030e07d5e Closes-Bug: #1618666
This commit is contained in:
parent
36e7dbffe7
commit
e7d88230b0
@ -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,7 +59,11 @@ class FunctionalTestBase(base.ClientTestBase):
|
||||
def _get_config(self):
|
||||
config_file = os.environ.get('IRONICCLIENT_TEST_CONFIG',
|
||||
DEFAULT_CONFIG_FILE)
|
||||
config = config_parser.SafeConfigParser()
|
||||
# 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)
|
||||
try:
|
||||
|
Loading…
x
Reference in New Issue
Block a user