svn path=/trunk/packages/sipb-xen-www/; revision=554
bootMachine(machine, cdrom)
return machine
-def getList(machines):
- """Return a dictionary mapping machine to dicts."""
+def getList():
+ """Return a dictionary mapping machine names to dicts."""
value_string = remctl('web', 'listvms')
value_dict = yaml.safe_load(value_string)
-
- d = dict((m, value_dict[m.name]) for m in machines if m.name in value_dict)
- return d
+ return value_dict
def parseStatus(s):
"""Parse a status string into nested tuples of strings.
has_vnc = {}
xmlist = g.xmlist
checkpoint.checkpoint('Got uptimes')
- can_clone = (controls.getList([Machine.get_by(name='ice3')])) == {}
+ can_clone = 'ice3' in g.xmlist_raw
for m in machines:
if m not in xmlist:
has_vnc[m] = 'Off'
machines = cachedproperty(lambda self:
Machine.query().join('acl').select_by(user=self.user))
+ xmlist_raw = cachedproperty(lambda self: controls.getList())
xmlist = cachedproperty(lambda self:
- controls.getList(self.machines))
+ dict((m, self.xmlist_raw[m.name])
+ for m in self.machines
+ if m.name in self.xmlist_raw))
def clear(self):
"""Clear the state so future accesses reload it."""