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:
parent
c9ae2ffcd3
commit
4af2e14e92
@ -11,13 +11,13 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import ConfigParser
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_utils import strutils
|
from oslo_utils import strutils
|
||||||
import pbr.version
|
import pbr.version
|
||||||
|
from six.moves import configparser
|
||||||
|
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
@ -28,7 +28,7 @@ VERSION = pbr.version.VersionInfo(DOMAIN).release_string()
|
|||||||
# find and parse callback config file
|
# find and parse callback config file
|
||||||
def parse_callback_config():
|
def parse_callback_config():
|
||||||
basename = os.path.splitext(__file__)[0]
|
basename = os.path.splitext(__file__)[0]
|
||||||
config = ConfigParser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
callback_config = {'ironic_config': None,
|
callback_config = {'ironic_config': None,
|
||||||
'ironic_log_file': None,
|
'ironic_log_file': None,
|
||||||
'use_journal': True,
|
'use_journal': True,
|
||||||
|
Loading…
Reference in New Issue
Block a user