fix config resolve

This commit is contained in:
Maxim Slipenko 2023-09-07 12:36:22 +03:00
parent a373c65a73
commit fdf6609b9b

View File

@ -76,8 +76,10 @@ class KeeneticAPI:
def interfaces(args): def interfaces(args):
config_file = os.path.normpath(os.path.join(parent_dir, args.config_file))
config = ConfigParser.ConfigParser() config = ConfigParser.ConfigParser()
config.read(args.config_file) config.read(config_file)
api = KeeneticAPI() api = KeeneticAPI()
api.auth( api.auth(
config.get('auth', 'login'), config.get('auth', 'login'),
@ -97,8 +99,10 @@ def interfaces(args):
print "{:^{width}} {:^{width}}".format(iface, (ifaces[iface].get('description') or '-'), width=max_len) print "{:^{width}} {:^{width}}".format(iface, (ifaces[iface].get('description') or '-'), width=max_len)
def start(args): def start(args):
config_file = os.path.normpath(os.path.join(parent_dir, args.config_file))
config = ConfigParser.ConfigParser() config = ConfigParser.ConfigParser()
config.read(args.config_file) config.read(config_file)
api = KeeneticAPI() api = KeeneticAPI()
api.auth( api.auth(