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:
Toshio Kuratomi 2017-02-03 10:01:53 -08:00
commit f75ffe46db
8 changed files with 41 additions and 45 deletions

View file

@ -21,13 +21,7 @@ from io import StringIO
import os
import re
try:
# python2
import ConfigParser as configparser
except ImportError:
# python3
import configparser
from ansible.compat.six.moves import configparser
from ansible.errors import AnsibleError
from ansible.plugins.lookup import LookupBase
from ansible.module_utils._text import to_bytes, to_text