Replace deprecated readfp method with read_file
The readfp method has been deprecated since version 3.2 [1].
[1]
@@ -27,11 +27,12 @@ from pbr import util
def config_from_ini(ini):
config = {}
+ ini = textwrap.dedent(six.u(ini))
if sys.version_info >= (3, 2):
parser = configparser.ConfigParser()
+ parser.read_file(io.StringIO(ini))
else:
parser = configparser.SafeConfigParser()
- ini = textwrap.dedent(six.u(ini))
parser.readfp(io.StringIO(ini))
for section in parser.sections():
config[section] = dict(parser.items(section))
