mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-24 15:15:22 +00:00
fix key checking in dict which could be causes KeyError
This commit is contained in:
parent
360f212583
commit
f1dbc6a199
1 changed files with 2 additions and 2 deletions
|
@ -528,8 +528,8 @@ class wvmInstance(wvmConnect):
|
|||
mem_usage = {}
|
||||
if self.get_status() == 1:
|
||||
mem_stats = self.instance.memoryStats()
|
||||
rss = mem_stats['rss'] if mem_stats['rss'] else 0
|
||||
total = mem_stats['actual'] if mem_stats['actual'] else 0
|
||||
rss = mem_stats['rss'] if 'rss' in mem_stats else 0
|
||||
total = mem_stats['actual'] if 'actual' in mem_stats else 0
|
||||
available = total - rss
|
||||
if available < 0: available = 0
|
||||
|
||||
|
|
Loading…
Reference in a new issue