Commit f15e0158 authored by Marco Mariani's avatar Marco Mariani

expand ~ in configuration path

parent d134c8ef
...@@ -54,16 +54,17 @@ class ConfigCommand(Command): ...@@ -54,16 +54,17 @@ class ConfigCommand(Command):
def fetch_config(self, args): def fetch_config(self, args):
if args.cfg: if args.cfg:
cfg_path = os.path.expanduser(args.cfg) cfg_path = args_cfg
else: else:
cfg_path = os.environ.get(self.default_config_var, self.default_config_path) cfg_path = os.environ.get(self.default_config_var, self.default_config_path)
cfg_path = os.path.expanduser(cfg_path)
self.log.debug('Loading config: %s' % cfg_path) self.log.debug('Loading config: %s' % cfg_path)
return self._get_config(cfg_path, required=True) return self._get_config(cfg_path, required=True)
class ClientConfigCommand(ConfigCommand): class ClientConfigCommand(ConfigCommand):
# XXX does not fallback to SLAPOS_CONFIGURATION
default_config_var = 'SLAPOS_CLIENT_CONFIGURATION' default_config_var = 'SLAPOS_CLIENT_CONFIGURATION'
default_config_path = '~/.slapos/slapos.cfg' default_config_path = '~/.slapos/slapos.cfg'
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