Skip to content

Commit 4ad5d1a

Browse files
committed
cli: Fix nonetype issue with cachemaker and exit after printing version
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
1 parent d7f9aa6 commit 4ad5d1a

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

tools/cli/cloudmonkey/cachemaker.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ def monkeycache(apis):
100100
cache['count'] = getvalue(apis[responsekey], 'count')
101101
cache['asyncapis'] = []
102102

103-
for api in getvalue(apis[responsekey], 'api'):
103+
apilist = getvalue(apis[responsekey], 'api')
104+
if apilist == None:
105+
print "[monkeycache] Server response issue, no apis found"
106+
107+
for api in apilist:
104108
name = getvalue(api, 'name')
105109
verb, subject = splitverbsubject(name)
106110

tools/cli/cloudmonkey/cloudmonkey.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,7 @@ def main():
487487
if options.version:
488488
print "cloudmonkey", __version__
489489
print __description__, "(%s)" % __projecturl__
490+
sys.exit(0)
490491

491492
shell = CloudMonkeyShell(sys.argv[0], options.cfile)
492493
if len(args) > 1:

0 commit comments

Comments
 (0)