Commit c22183b9 authored by Stavros Sachtouris's avatar Stavros Sachtouris
Browse files

Allow kamaki-shell to ignore unrecognized commands

parent 039236fd
......@@ -512,12 +512,11 @@ def main(foo):
filelog = logger.add_file_logger(__name__.split('.')[0])
filelog.info('* Initial Call *\n%s\n- - -' % ' '.join(argv))
cloud = _init_session(parser.arguments, is_non_API(parser))
from kamaki.cli.utils import suggest_missing
global _colors
exclude = ['ansicolors'] if not _colors == 'on' else []
suggest_missing(exclude=exclude)
foo(exe, parser, cloud)
foo(exe, parser)
except CLIError as err:
print_error_message(err)
if _debug:
......@@ -535,7 +534,9 @@ def main(foo):
@main
def run_shell(exe, parser, cloud):
def run_shell(exe, parser):
parser.arguments['help'].value = False
cloud = _init_session(parser.arguments)
from command_shell import _init_shell
global kloger
_cnf = parser.arguments['config']
......@@ -551,7 +552,8 @@ def run_shell(exe, parser, cloud):
@main
def run_one_cmd(exe, parser, cloud):
def run_one_cmd(exe, parser):
cloud = _init_session(parser.arguments, is_non_API(parser))
if parser.unparsed:
global _history
try:
......
......@@ -103,7 +103,7 @@ class ConfigArgument(Argument):
@property
def value(self):
return super(ConfigArgument, self).value
return getattr(self, '_value', None)
@value.setter
def value(self, config_file):
......
......@@ -291,7 +291,7 @@ class Config(RawConfigParser):
:raises KeyError: if cloud or cloud's option does not exist
"""
r = self.get(CLOUD_PREFIX, cloud)
r = self.get(CLOUD_PREFIX, cloud) if cloud else None
if not r:
raise KeyError('Cloud "%s" does not exist' % cloud)
return r[option]
......
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