Make ironic_log Ansible callback Python 3 ready

Add Python version detection to decide which of configparser (3)
or ConfigParser (2) should be imported.

Change-Id: If80095ca553d98e5e7b7a3818324fd730e9ddc8e
Story: 2006418
Task: 36308
This commit is contained in:
Gaëtan Trellu 2019-08-19 13:31:00 -04:00
parent c9ae2ffcd3
commit 4af2e14e92

View File

@ -11,13 +11,13 @@
# License for the specific language governing permissions and limitations
# under the License.
import ConfigParser
import os
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import strutils
import pbr.version
from six.moves import configparser
CONF = cfg.CONF
@ -28,7 +28,7 @@ VERSION = pbr.version.VersionInfo(DOMAIN).release_string()
# find and parse callback config file
def parse_callback_config():
basename = os.path.splitext(__file__)[0]
config = ConfigParser.ConfigParser()
config = configparser.ConfigParser()
callback_config = {'ironic_config': None,
'ironic_log_file': None,
'use_journal': True,