Skip to content

Commit

Permalink
Change section 'DEFAULT' to 'DEFAULTS' in contrail-database-nodemgr.conf
Browse files Browse the repository at this point in the history
python ConfigParser treats section 'DEFAULT' as special and
whatever is in the 'DEFAULT' section is propagated to every other
section. Due to this, the current code in nodemgr is working only
as a result of parsing the 'DISCOVERY' section and it fails once
the 'DISCOVERY' section is removed.

Change-Id: I16da136de441cdcedbd2ecfaaf6c86e8451e2206
Partial-Bug: #1660535
  • Loading branch information
Megh Bhatt committed Feb 1, 2017
1 parent b2ebcda commit e1d547e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[DEFAULT]
[DEFAULTS]
hostip=127.0.0.1
#contrail_databases=config analytics
minimum_diskGB=4
Expand Down
7 changes: 4 additions & 3 deletions src/nodemgr/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ def main(args_str=' '.join(sys.argv[1:])):
return
config = ConfigParser.SafeConfigParser()
config.read([config_file])
if 'DEFAULT' in config.sections():
default.update(dict(config.items('DEFAULT')))
if 'DEFAULTS' in config.sections():
default.update(dict(config.items('DEFAULTS')))
if 'DISCOVERY' in config.sections():
disc_options.update(dict(config.items('DISCOVERY')))
disc_options['discovery_server'] = disc_options.pop('server')
Expand Down Expand Up @@ -146,8 +146,9 @@ def main(args_str=' '.join(sys.argv[1:])):
parser.add_argument("--introspect_ssl_enable", action="store_true",
help="Enable ssl for introspect connection")
if (node_type == 'contrail-database'):
parser.add_argument("--minimum_diskgb",
parser.add_argument("--minimum_diskGB",
type=int,
dest='minimum_diskgb',
help="Minimum disk space in GB's")
parser.add_argument("--contrail_databases",
nargs='+',
Expand Down

0 comments on commit e1d547e

Please sign in to comment.