Disable image cloning when ice3 is booted - this should work as a locking
[invirt/packages/invirt-web.git] / code / main.py
index ce523cb..60c2818 100755 (executable)
@@ -203,6 +203,7 @@ def getListDict(user):
     has_vnc = {}
     xmlist = g.xmlist
     checkpoint.checkpoint('Got uptimes')
     has_vnc = {}
     xmlist = g.xmlist
     checkpoint.checkpoint('Got uptimes')
+    can_clone = (controls.getList([Machine.get_by(name='ice3')])) == {}
     for m in machines:
         if m not in xmlist:
             has_vnc[m] = 'Off'
     for m in machines:
         if m not in xmlist:
             has_vnc[m] = 'Off'
@@ -232,7 +233,8 @@ def getListDict(user):
              max_disk=max_disk,
              defaults=defaults,
              machines=machines,
              max_disk=max_disk,
              defaults=defaults,
              machines=machines,
-             has_vnc=has_vnc)
+             has_vnc=has_vnc,
+             can_clone=can_clone)
     return d
 
 def listVms(user, fields):
     return d
 
 def listVms(user, fields):