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