Commit e9a92550 authored by Stavros Sachtouris's avatar Stavros Sachtouris

Fix config-forget bug

parent 852a22e7
......@@ -419,6 +419,7 @@ def main():
exit(0)
_init_session(_arguments)
print('ICN[%s]' % _arguments['config'].value)
if unparsed:
_history = History(_arguments['config'].get('history', 'file'))
......
......@@ -116,6 +116,8 @@ class Argument(object):
class ConfigArgument(Argument):
_config_file = None
@property
def value(self):
super(self.__class__, self).value
......@@ -123,7 +125,13 @@ class ConfigArgument(Argument):
@value.setter
def value(self, config_file):
self._value = Config(config_file) if config_file else Config()
if config_file:
self._value = Config(config_file)
self._config_file = config_file
elif self._config_file:
self._value = Config(self._config_file)
else:
self._value = Config()
def get(self, group, term):
return self.value.get(group, term)
......
......@@ -37,7 +37,7 @@ from sys import stdout
from argparse import ArgumentParser
from kamaki.cli import _exec_cmd, _print_error_message
from kamaki.cli.argument import _arguments, update_arguments
from kamaki.cli.argument import update_arguments
from kamaki.cli.utils import print_dict
from kamaki.cli.history import History
from kamaki.cli.errors import CLIError
......@@ -47,6 +47,7 @@ def _init_shell(exe_string, arguments):
arguments.pop('version', None)
arguments.pop('options', None)
arguments.pop('history', None)
print('SHELL? [%s]' % arguments['config'].value)
shell = Shell()
shell.set_prompt(exe_string)
from kamaki import __version__ as version
......
......@@ -37,7 +37,7 @@ from kamaki.cli.commands import _command_init
from kamaki.cli.command_tree import CommandTree
config_cmds = CommandTree('config', 'Configuration commands')
_command = [config_cmds]
_commands = [config_cmds]
@command(config_cmds)
......
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