Commit 507a5eb6 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Revert 93ec8ed4 as only key_file and cert_file from slapconsole section is used.

parent b80a2195
...@@ -91,22 +91,24 @@ class Config: ...@@ -91,22 +91,24 @@ 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
for section in ('slapos', 'slapconsole'): try:
try: configuration_dict = dict(configuration_parser.items("slapconsole"))
configuration_dict = dict(configuration_parser.items(section)) except ConfigParser.NoSectionError:
except ConfigParser.NoSectionError: pass
pass else:
else: for key in configuration_dict:
for key in configuration_dict: if not getattr(self, key, None):
setattr(self, key, configuration_dict[key]) setattr(self, key, configuration_dict[key])
configuration_dict = dict(configuration_parser.items('slapos'))
master_url = getattr(self, 'master_url', None) master_url = configuration_dict.get('master_url', None)
if not master_url: if not master_url:
raise ValueError("No option 'master_url'") raise ValueError("No option 'master_url'")
elif master_url.startswith('https') and \ elif master_url.startswith('https') and \
not getattr(self, 'key_file', None) and \ not getattr(self, 'key_file', None) and \
not getattr(self, 'cert_file', None): not getattr(self, 'cert_file', None):
raise ValueError("No option 'key_file' and/or 'cert_file'") raise ValueError("No option 'key_file' and/or 'cert_file'")
else:
setattr(self, 'master_url', master_url)
def init(config): def init(config):
......
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