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
No related merge requests found
...@@ -77,17 +77,15 @@ class Config: ...@@ -77,17 +77,15 @@ class Config:
configuration_parser = ConfigParser.SafeConfigParser() configuration_parser = ConfigParser.SafeConfigParser()
configuration_parser.read(configuration_file_path) configuration_parser.read(configuration_file_path)
# Merges the arguments and configuration # Merges the arguments and configuration
try: for section in ('slapos', 'slapconsole'):
configuration_dict = dict(configuration_parser.items("slapos")) try:
except ConfigParser.NoSectionError: configuration_dict = dict(configuration_parser.items(section))
pass except ConfigParser.NoSectionError:
else: pass
for key in configuration_dict: else:
if not getattr(self, key, None): for key in configuration_dict:
setattr(self, key, configuration_dict[key]) 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: if not self.master_url:
raise ValueError('master_url is required.') 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