Changeset 554 for trunk/packages
- Timestamp:
- Jun 2, 2008, 1:48:27 AM (17 years ago)
- Location:
- trunk/packages/sipb-xen-www/code
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-www/code/controls.py
r550 r554 138 138 return machine 139 139 140 def getList( machines):141 """Return a dictionary mapping machine to dicts."""140 def getList(): 141 """Return a dictionary mapping machine names to dicts.""" 142 142 value_string = remctl('web', 'listvms') 143 143 value_dict = yaml.safe_load(value_string) 144 145 d = dict((m, value_dict[m.name]) for m in machines if m.name in value_dict) 146 return d 144 return value_dict 147 145 148 146 def parseStatus(s): -
trunk/packages/sipb-xen-www/code/main.py
r540 r554 204 204 xmlist = g.xmlist 205 205 checkpoint.checkpoint('Got uptimes') 206 can_clone = (controls.getList([Machine.get_by(name='ice3')])) == {}206 can_clone = 'ice3' in g.xmlist_raw 207 207 for m in machines: 208 208 if m not in xmlist: -
trunk/packages/sipb-xen-www/code/webcommon.py
r535 r554 44 44 machines = cachedproperty(lambda self: 45 45 Machine.query().join('acl').select_by(user=self.user)) 46 xmlist_raw = cachedproperty(lambda self: controls.getList()) 46 47 xmlist = cachedproperty(lambda self: 47 controls.getList(self.machines)) 48 dict((m, self.xmlist_raw[m.name]) 49 for m in self.machines 50 if m.name in self.xmlist_raw)) 48 51 49 52 def clear(self):
Note: See TracChangeset
for help on using the changeset viewer.