From 4af2e14e926d95077aae8133a69dda65f92a8a1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Trellu?= Date: Mon, 19 Aug 2019 13:31:00 -0400 Subject: [PATCH] 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 --- .../modules/ansible/playbooks/callback_plugins/ironic_log.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ironic/drivers/modules/ansible/playbooks/callback_plugins/ironic_log.py b/ironic/drivers/modules/ansible/playbooks/callback_plugins/ironic_log.py index e3fb9d3ef1..fde84d4d9a 100644 --- a/ironic/drivers/modules/ansible/playbooks/callback_plugins/ironic_log.py +++ b/ironic/drivers/modules/ansible/playbooks/callback_plugins/ironic_log.py @@ -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,