Don't use deprecated configparser.readfp

Running verify_tempest_config, it complains with:
  /opt/stack/tempest/tempest/cmd/verify_tempest_config.py:444:
  DeprecationWarning: This method will be removed in future versions.
  Use 'parser.read_file()' instead.

Use read_file.

Also, remove one extra use of six in this file.

Change-Id: Ia32df8e2be29bb0951efd08db9eed9e67d749e1f
This commit is contained in:
Andreas Jaeger 2020-05-05 13:27:32 +02:00
parent e8f1876aa6
commit 2f273243fc
1 changed files with 4 additions and 4 deletions

View File

@ -60,16 +60,16 @@ name (tempest.conf) is overridden.
"""
import argparse
import configparser
import os
import re
import sys
import traceback
from urllib import parse as urlparse
from cliff import command
from oslo_log import log as logging
from oslo_serialization import jsonutils as json
from six import moves
from six.moves.urllib import parse as urlparse
from tempest import clients
from tempest.common import credentials_factory as credentials
@ -439,9 +439,9 @@ def main(opts=None):
if update:
conf_file = _get_config_file()
CONF_PARSER = moves.configparser.ConfigParser()
CONF_PARSER = configparser.ConfigParser()
CONF_PARSER.optionxform = str
CONF_PARSER.readfp(conf_file)
CONF_PARSER.read_file(conf_file)
# Indicate not to create network resources as part of getting credentials
net_resources = {