Revision ee6c7b94 daemons/ganeti-masterd
b/daemons/ganeti-masterd | ||
---|---|---|
227 | 227 |
(job_ids, fields) = args |
228 | 228 |
return queue.QueryJobs(job_ids, fields) |
229 | 229 |
|
230 |
elif method == luxi.REQ_QUERY_INSTANCES: |
|
231 |
(names, fields) = args |
|
232 |
op = opcodes.OpQueryInstances(names=names, output_fields=fields) |
|
233 |
return self._Query(op) |
|
234 |
|
|
230 | 235 |
else: |
231 | 236 |
raise ValueError("Invalid operation") |
232 | 237 |
|
238 |
def _DummyLog(self, *args): |
|
239 |
pass |
|
240 |
|
|
241 |
def _Query(self, op): |
|
242 |
"""Runs the specified opcode and returns the result. |
|
243 |
|
|
244 |
""" |
|
245 |
proc = mcpu.Processor(self.server.context) |
|
246 |
# TODO: Where should log messages go? |
|
247 |
return proc.ExecOpCode(op, self._DummyLog) |
|
248 |
|
|
233 | 249 |
|
234 | 250 |
class GanetiContext(object): |
235 | 251 |
"""Context common to all ganeti threads. |
Also available in: Unified diff