mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 06:10:22 -07:00
Make configparser imports python3 ready
the ConfigParser module was renamed to configparser in Python3. Use six.moves to import it so that the modules will function on Python3.
This commit is contained in:
parent
272ff10fa1
commit
f75ffe46db
8 changed files with 41 additions and 45 deletions
|
@ -36,12 +36,12 @@ except ImportError:
|
|||
# Let snippet from module_utils/basic.py return a proper error in this case
|
||||
pass
|
||||
|
||||
import urllib
|
||||
from ConfigParser import ConfigParser, NoSectionError
|
||||
import os
|
||||
|
||||
# import module snippets
|
||||
from ansible.module_utils.urls import *
|
||||
from ansible.module_utils.basic import *
|
||||
from ansible.module_utils.pycompat24 import get_exception
|
||||
from ansible.module_utils.six.moves import configparser
|
||||
from ansible.module_utils.urls import fetch_url
|
||||
|
||||
EXO_DNS_BASEURL="https://api.exoscale.ch/dns/v1"
|
||||
|
||||
|
@ -115,7 +115,7 @@ class ExoDns(object):
|
|||
raise SystemExit("Config file not found. Tried {0}".format(
|
||||
", ".join(paths)))
|
||||
|
||||
conf = ConfigParser()
|
||||
conf = configparser.ConfigParser()
|
||||
conf.read(paths)
|
||||
return dict(conf.items(ini_group))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue