Skip to content

Commit

Permalink
Handle runningInstances being None.
Browse files Browse the repository at this point in the history
  • Loading branch information
cluther committed Apr 26, 2011
1 parent 9971888 commit 49a0e3d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ZenPacks/zenoss/CloudFoundry/parsers/endpoint.py
Expand Up @@ -16,7 +16,10 @@ def processResults(self, cmd, result):
usageAppRunningInstances = 0
for app in data['apps']:
usageAppInstances += len(app['instances'])
usageAppRunningInstances += app['runningInstances']

runningInstances = app.get('runningInstances', None)
if runningInstances is not None:
usageAppRunningInstances += runningInstances

usageAppURIs = data['info']['usage']['app_uris']
usageApps = data['info']['usage']['apps']
Expand Down

0 comments on commit 49a0e3d

Please sign in to comment.