Permalink
Browse files

Handle runningInstances being None.

  • Loading branch information...
1 parent 9971888 commit 49a0e3d9c25daf433f0b1103157f4810c8a1d75b @cluther cluther committed Apr 26, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 ZenPacks/zenoss/CloudFoundry/parsers/endpoint.py
@@ -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']

0 comments on commit 49a0e3d

Please sign in to comment.