cli: Fix attribute error and fix helpdoc

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
Rohit Yadav 2013-02-06 16:51:38 +05:30
parent 2a0c2be136
commit d99f836d5d

View File

@ -65,6 +65,7 @@ class CloudMonkeyShell(cmd.Cmd, object):
ruler = "=" ruler = "="
cache_file = cache_file cache_file = cache_file
config_options = [] config_options = []
verbs = []
def __init__(self, pname): def __init__(self, pname):
self.program_name = pname self.program_name = pname
@ -246,7 +247,7 @@ class CloudMonkeyShell(cmd.Cmd, object):
args_dict.pop('filter').split(','))) args_dict.pop('filter').split(',')))
missing_args = [] missing_args = []
if verb in self.apicache: if verb in self.apicache and subject in self.apicache[verb]:
missing_args = filter(lambda x: x not in args_dict.keys(), missing_args = filter(lambda x: x not in args_dict.keys(),
self.apicache[verb][subject]['requiredparams']) self.apicache[verb][subject]['requiredparams'])
@ -388,7 +389,6 @@ class CloudMonkeyShell(cmd.Cmd, object):
if subject in self.apicache[verb]: if subject in self.apicache[verb]:
api = self.apicache[verb][subject] api = self.apicache[verb][subject]
helpdoc = "(%s) %s" % (api['name'], api['description']) helpdoc = "(%s) %s" % (api['name'], api['description'])
helpdoc = api['description']
if api['isasync']: if api['isasync']:
helpdoc += "\nThis API is asynchronous." helpdoc += "\nThis API is asynchronous."
required = api['requiredparams'] required = api['requiredparams']