Commit 74ef042c authored by Marco Mariani's avatar Marco Mariani

simpler getSlaposConfiguration()

parent 7f52951e
...@@ -126,21 +126,16 @@ def get_yes_no(prompt, default=None): ...@@ -126,21 +126,16 @@ def get_yes_no(prompt, default=None):
def getSlaposConfiguration(slapos_configuration_file_path=None): def getSlaposConfiguration(slapos_configuration_file_path=None):
config = ConfigParser.RawConfigParser() for path in [
# Search slapos.cfg slapos_configuration_file_path,
if not slapos_configuration_file_path: '/etc/opt/slapos/slapos.cfg',
slapos_configuration_file_path = "/etc/opt/slapos/slapos.cfg" '/etc/slapos/slapos.cfg'
slapos_configuration_file_path_old = "/etc/slapos/slapos.cfg" ]:
if path and os.path.isfile(path):
if not os.path.isfile(slapos_configuration_file_path): config = ConfigParser.RawConfigParser()
if os.path.isfile(slapos_configuration_file_path_old): config.read(path)
slapos_configuration_file_path = slapos_configuration_file_path_old return config
else: return {}
# No configuration found : returning
return {}
# Reading slapos paths from configuration file
config.read(slapos_configuration_file_path)
return config
# Return OpenSUSE version if it is SuSE # Return OpenSUSE version if it is SuSE
......
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