model info typererror
This commit is contained in:
parent
fb8a9081fb
commit
ae366239d9
@ -127,13 +127,13 @@ class Node(Base, BasicValidator):
|
|||||||
kilobytes = int(self.meta['memory']['total'][:-2])
|
kilobytes = int(self.meta['memory']['total'][:-2])
|
||||||
gigabytes = kilobytes / 1024.0 ** 2
|
gigabytes = kilobytes / 1024.0 ** 2
|
||||||
result['ram'] = gigabytes
|
result['ram'] = gigabytes
|
||||||
except (KeyError, ValueError):
|
except (KeyError, ValueError, TypeError):
|
||||||
result['ram'] = None
|
result['ram'] = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
result['cpu'] = self.meta['cpu']['real']
|
result['cpu'] = self.meta['cpu']['real']
|
||||||
result['cores'] = self.meta['cpu']['total']
|
result['cores'] = self.meta['cpu']['total']
|
||||||
except (KeyError, ValueError):
|
except (KeyError, ValueError, TypeError):
|
||||||
result['cpu'] = None
|
result['cpu'] = None
|
||||||
result['cores'] = None
|
result['cores'] = None
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user