Add strict False param for Config parser
Py3 RawConfigParser does not allow options duplication. Change-Id: I6ab4ebf7cefc7a33171b92bf784a7e5416535c7a
This commit is contained in:
parent
5c97d5bc2a
commit
4d591f4363
@ -29,8 +29,10 @@ import os
|
||||
import sys
|
||||
try:
|
||||
import ConfigParser
|
||||
PARSER_OPTS = {}
|
||||
except ImportError:
|
||||
import configparser as ConfigParser
|
||||
PARSER_OPTS = {"strict": False}
|
||||
import logging
|
||||
from sqlalchemy import create_engine
|
||||
|
||||
@ -68,7 +70,7 @@ if "OPENSTACK_CONFIG_FILE" in os.environ:
|
||||
logger.critical('environment variable OPENSTACK_CONFIG_DB_KEY not set')
|
||||
sys.exit(1)
|
||||
try:
|
||||
config = ConfigParser.RawConfigParser()
|
||||
config = ConfigParser.RawConfigParser(**PARSER_OPTS)
|
||||
logger.info("Using {0} as db config source".format(os_conf))
|
||||
config.read(os_conf)
|
||||
logger.info("Trying to load db config from {0}:{1}".format(
|
||||
|
@ -29,8 +29,10 @@ import os
|
||||
import sys
|
||||
try:
|
||||
import ConfigParser
|
||||
PARSER_OPTS = {}
|
||||
except ImportError:
|
||||
import configparser as ConfigParser
|
||||
PARSER_OPTS = {"strict": False}
|
||||
import logging
|
||||
from sqlalchemy import create_engine
|
||||
|
||||
@ -68,7 +70,7 @@ if "OPENSTACK_CONFIG_FILE" in os.environ:
|
||||
logger.critical('environment variable OPENSTACK_CONFIG_DB_KEY not set')
|
||||
sys.exit(1)
|
||||
try:
|
||||
config = ConfigParser.RawConfigParser()
|
||||
config = ConfigParser.RawConfigParser(**PARSER_OPTS)
|
||||
logger.info("Using {0} as db config source".format(os_conf))
|
||||
config.read(os_conf)
|
||||
logger.info("Trying to load db config from {0}:{1}".format(
|
||||
|
Loading…
Reference in New Issue
Block a user