model info typererror

This commit is contained in:
Nikolay Markov 2012-09-20 18:22:39 +04:00 committed by default
parent fb8a9081fb
commit ae366239d9

View File

@ -127,13 +127,13 @@ class Node(Base, BasicValidator):
kilobytes = int(self.meta['memory']['total'][:-2])
gigabytes = kilobytes / 1024.0 ** 2
result['ram'] = gigabytes
except (KeyError, ValueError):
except (KeyError, ValueError, TypeError):
result['ram'] = None
try:
result['cpu'] = self.meta['cpu']['real']
result['cores'] = self.meta['cpu']['total']
except (KeyError, ValueError):
except (KeyError, ValueError, TypeError):
result['cpu'] = None
result['cores'] = None