Commit 2a985170 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Get all options of slapconsole section after those from slapconsole.

Previously, cert_file and key_file could  only be set from slapconsole section
but  as it's  supposed to  already been  defined in  slapos section,  then use
slapos values first, then fallback on slapconsole section.
parent 93ec8ed4
......@@ -77,16 +77,14 @@ class Config:
configuration_parser = ConfigParser.SafeConfigParser()
configuration_parser.read(configuration_file_path)
# Merges the arguments and configuration
for section in ('slapos', 'slapconsole'):
try:
configuration_dict = dict(configuration_parser.items("slapos"))
configuration_dict = dict(configuration_parser.items(section))
except ConfigParser.NoSectionError:
pass
else:
for key in configuration_dict:
if not getattr(self, key, None):
setattr(self, key, configuration_dict[key])
configuration_dict = dict(configuration_parser.items('slapos'))
setattr(self, 'master_url', configuration_dict['master_url'])
if not self.master_url:
raise ValueError('master_url is required.')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment