mirror of
https://github.com/retspen/webvirtcloud.git
synced 2026-05-26 23:19:40 +00:00
fix key checking in dict which could be causes KeyError
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user