From 18eb0699531716f3ed495d1e4677c8b981a35439 Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Sat, 31 May 2008 01:18:40 -0400 Subject: [PATCH] Disable image cloning when ice3 is booted - this should work as a locking mechanism svn path=/trunk/packages/sipb-xen-www/; revision=540 --- code/main.py | 4 +++- code/templates/list.tmpl | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/code/main.py b/code/main.py index ce523cb..60c2818 100755 --- a/code/main.py +++ b/code/main.py @@ -203,6 +203,7 @@ def getListDict(user): 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' @@ -232,7 +233,8 @@ def getListDict(user): 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): diff --git a/code/templates/list.tmpl b/code/templates/list.tmpl index c55261c..5c6f2c5 100644 --- a/code/templates/list.tmpl +++ b/code/templates/list.tmpl @@ -61,9 +61,13 @@ $errorRow('vmtype', $err) #end filter Clone image? +#if $can_clone (experimental; 1-2 minutes, and you have an etch machine; root pw is 'password'.) +#else + Image cloning is currently disabled for maintenence +#end if #filter None $errorRow('autoinstall', $err) -- 1.7.9.5