Put a try block around maxMemory call

This commit is contained in:
Joshua Boniface 2018-07-17 21:42:28 -04:00
parent 2c988430db
commit 329aa93d81
1 changed files with 5 additions and 1 deletions

View File

@ -44,7 +44,11 @@ class VMInstance:
self.instop = False self.instop = False
self.dom = self.lookupByUUID(self.domuuid) self.dom = self.lookupByUUID(self.domuuid)
self.maxmemory = self.dom.maxMemory()
try:
self.maxmemory = self.dom.maxMemory()
except:
self.maxmemory = 0
# Watch for changes to the state field in Zookeeper # Watch for changes to the state field in Zookeeper
@zk_conn.DataWatch('/domains/{}/state'.format(self.domuuid)) @zk_conn.DataWatch('/domains/{}/state'.format(self.domuuid))