Update ConfigParser imports for python3

We're starting to run jeepyb under python3 in the new gerrit image.

Change-Id: Ia71cb13f3b45055bbb9a311807fa65a89c8be62a
This commit is contained in:
Monty Taylor 2020-03-21 16:09:11 -05:00
parent 2bb53ddb7f
commit 20808ddc5d
8 changed files with 15 additions and 14 deletions

View File

@ -39,7 +39,7 @@
# oauth_token = GITHUB_OAUTH_TOKEN
import argparse
import ConfigParser
from six.moves import configparser
import github
import logging
import os
@ -87,7 +87,7 @@ def main():
GITHUB_SECURE_CONFIG = os.environ.get('GITHUB_SECURE_CONFIG',
'/etc/github/github.secure.config')
secure_config = ConfigParser.ConfigParser()
secure_config = configparser.ConfigParser()
secure_config.read(GITHUB_SECURE_CONFIG)
registry = u.ProjectsRegistry()

View File

@ -51,7 +51,7 @@
# project: OTHER_PROJECT_NAME
import argparse
import ConfigParser
from six.moves import configparser
import glob
import hashlib
import json
@ -273,7 +273,7 @@ def create_update_github_project(
if not needs_update:
return False
secure_config = ConfigParser.ConfigParser()
secure_config = configparser.ConfigParser()
secure_config.read(github_secure_config)
global orgs

View File

@ -23,7 +23,7 @@ from __future__ import print_function
__author__ = "Chmouel Boudjnah <chmouel@chmouel.com>"
import ConfigParser
from six.moves import configparser
import cStringIO
import datetime
import json
@ -63,7 +63,7 @@ def parse_ini(inifile):
ret = {}
if not os.path.exists(inifile):
return
config = ConfigParser.RawConfigParser(allow_no_value=True)
config = configparser.RawConfigParser(allow_no_value=True)
config.read(inifile)
if config.has_section('swift'):

View File

@ -18,7 +18,7 @@
# corresponding Launchpad blueprints with links back to the change.
import argparse
import ConfigParser
from six.moves import configparser
import os
import re
import StringIO
@ -55,7 +55,7 @@ def get_broken_config(filename):
text = "%s%s" % (text, line.lstrip())
fp = StringIO.StringIO(text)
c = ConfigParser.ConfigParser()
c = configparser.ConfigParser()
c.readfp(fp)
return c

View File

@ -14,7 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import ConfigParser
from six.moves import configparser
import os
import StringIO
@ -35,7 +35,7 @@ def get_broken_config(filename):
text += line.lstrip()
fp = StringIO.StringIO(text)
c = ConfigParser.ConfigParser()
c = configparser.ConfigParser()
c.readfp(fp)
return c

View File

@ -26,7 +26,7 @@ Expected review.projects.yaml format:
- no-launchpad-blueprints
"""
import ConfigParser
from six.moves import configparser
import jeepyb.utils as u
@ -69,7 +69,7 @@ def has_github(project_full_name):
# ...and if it's not set, then still don't use it.
return False
# It's okay if the global option or even the section for this don't exist.
except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
except (configparser.NoSectionError, configparser.NoOptionError):
pass
# If we got this far, we either explicitly or implicitly default to use it.
return True

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import ConfigParser
from six.moves import configparser
import logging
import os
import shlex
@ -196,7 +196,7 @@ class ProjectsRegistry(object):
self._configs_list = self.yaml_doc[1]
if os.path.exists(PROJECTS_INI):
self.defaults = ConfigParser.ConfigParser()
self.defaults = configparser.ConfigParser()
self.defaults.read(PROJECTS_INI)
else:
try:

View File

@ -5,6 +5,7 @@ envlist = pep8
setenv = VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
basepython = python3
[testenv:pep8]
commands = flake8