cli: Fix nonetype issue with cachemaker and exit after printing version

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
Rohit Yadav 2013-03-20 12:42:29 +05:30
parent d7f9aa637e
commit 4ad5d1a4f5
2 changed files with 6 additions and 1 deletions

View File

@ -100,7 +100,11 @@ def monkeycache(apis):
cache['count'] = getvalue(apis[responsekey], 'count') cache['count'] = getvalue(apis[responsekey], 'count')
cache['asyncapis'] = [] cache['asyncapis'] = []
for api in getvalue(apis[responsekey], 'api'): apilist = getvalue(apis[responsekey], 'api')
if apilist == None:
print "[monkeycache] Server response issue, no apis found"
for api in apilist:
name = getvalue(api, 'name') name = getvalue(api, 'name')
verb, subject = splitverbsubject(name) verb, subject = splitverbsubject(name)

View File

@ -487,6 +487,7 @@ def main():
if options.version: if options.version:
print "cloudmonkey", __version__ print "cloudmonkey", __version__
print __description__, "(%s)" % __projecturl__ print __description__, "(%s)" % __projecturl__
sys.exit(0)
shell = CloudMonkeyShell(sys.argv[0], options.cfile) shell = CloudMonkeyShell(sys.argv[0], options.cfile)
if len(args) > 1: if len(args) > 1: