From fdf6609b9b5834a7464f628b71fc01830792965b Mon Sep 17 00:00:00 2001 From: Maxim Slipenko Date: Thu, 7 Sep 2023 12:36:22 +0300 Subject: [PATCH] fix config resolve --- main.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 852ed2a..94eed45 100644 --- a/main.py +++ b/main.py @@ -76,8 +76,10 @@ class KeeneticAPI: def interfaces(args): + config_file = os.path.normpath(os.path.join(parent_dir, args.config_file)) + config = ConfigParser.ConfigParser() - config.read(args.config_file) + config.read(config_file) api = KeeneticAPI() api.auth( config.get('auth', 'login'), @@ -97,8 +99,10 @@ def interfaces(args): print "{:^{width}} {:^{width}}".format(iface, (ifaces[iface].get('description') or '-'), width=max_len) def start(args): + config_file = os.path.normpath(os.path.join(parent_dir, args.config_file)) + config = ConfigParser.ConfigParser() - config.read(args.config_file) + config.read(config_file) api = KeeneticAPI() api.auth(