mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Use six.moves.configparser instead of ConfigParser
The module name was lowercased in Python 3. Reviewed-By: David Kupka <dkupka@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com> Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
committed by
Jan Cholasta
parent
ad2bc94725
commit
187efdfe42
@@ -17,11 +17,13 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
import ConfigParser
|
||||
from optparse import Option, Values, OptionParser, IndentedHelpFormatter, OptionValueError
|
||||
from copy import copy
|
||||
|
||||
from dns import resolver, rdatatype
|
||||
from dns.exception import DNSException
|
||||
from six.moves.configparser import SafeConfigParser
|
||||
|
||||
from ipapython.dn import DN
|
||||
from ipaplatform.paths import paths
|
||||
import dns.name
|
||||
@@ -152,7 +154,7 @@ class IPAConfig:
|
||||
config = IPAConfig()
|
||||
|
||||
def __parse_config(discover_server = True):
|
||||
p = ConfigParser.SafeConfigParser()
|
||||
p = SafeConfigParser()
|
||||
p.read(paths.IPA_DEFAULT_CONF)
|
||||
|
||||
try:
|
||||
|
||||
@@ -21,10 +21,10 @@ import collections
|
||||
import os
|
||||
import httplib
|
||||
import xml.dom.minidom
|
||||
import ConfigParser
|
||||
|
||||
import nss.nss as nss
|
||||
import six
|
||||
from six.moves import configparser
|
||||
from six.moves.urllib.parse import urlencode
|
||||
|
||||
from ipalib import api, errors
|
||||
@@ -143,11 +143,11 @@ def _get_configured_version(api):
|
||||
if api:
|
||||
return int(api.env.dogtag_version)
|
||||
else:
|
||||
p = ConfigParser.SafeConfigParser()
|
||||
p = configparser.SafeConfigParser()
|
||||
p.read(paths.IPA_DEFAULT_CONF)
|
||||
try:
|
||||
version = p.get('global', 'dogtag_version')
|
||||
except (ConfigParser.NoOptionError, ConfigParser.NoSectionError):
|
||||
except (configparser.NoOptionError, configparser.NoSectionError):
|
||||
return 9
|
||||
else:
|
||||
return int(version)
|
||||
|
||||
@@ -27,11 +27,11 @@ import os
|
||||
import os.path
|
||||
import shutil
|
||||
from ipapython.ipa_log_manager import *
|
||||
import ConfigParser
|
||||
import random
|
||||
import string
|
||||
|
||||
import six
|
||||
from six.moves.configparser import SafeConfigParser
|
||||
|
||||
from ipapython import ipautil
|
||||
from ipaplatform.tasks import tasks
|
||||
@@ -71,7 +71,7 @@ class FileStore:
|
||||
|
||||
self.files = {}
|
||||
|
||||
p = ConfigParser.SafeConfigParser()
|
||||
p = SafeConfigParser()
|
||||
p.read(self._index)
|
||||
|
||||
for section in p.sections():
|
||||
@@ -92,7 +92,7 @@ class FileStore:
|
||||
os.remove(self._index)
|
||||
return
|
||||
|
||||
p = ConfigParser.SafeConfigParser()
|
||||
p = SafeConfigParser()
|
||||
|
||||
p.add_section('files')
|
||||
for (key, value) in self.files.items():
|
||||
@@ -327,7 +327,7 @@ class StateFile:
|
||||
|
||||
self.modules = {}
|
||||
|
||||
p = ConfigParser.SafeConfigParser()
|
||||
p = SafeConfigParser()
|
||||
p.read(self._path)
|
||||
|
||||
for module in p.sections():
|
||||
@@ -355,7 +355,7 @@ class StateFile:
|
||||
os.remove(self._path)
|
||||
return
|
||||
|
||||
p = ConfigParser.SafeConfigParser()
|
||||
p = SafeConfigParser()
|
||||
|
||||
for module in self.modules.keys():
|
||||
p.add_section(module)
|
||||
|
||||
Reference in New Issue
Block a user