- logging.info("RPC CALL: compute list")
- if dc_name in self.dcs:
- return [(c.name, c.IP()) for c in self.dcs[dc_name].listCompute()]
+ logging.debug("RPC CALL: compute list")
+ try:
+ if dc_name is None:
+ # return list with all compute nodes in all DCs
+ all_containers = []
+ for dc in self.dcs.itervalues():
+ all_containers += dc.listCompute()
+ return [(c.name, c.getStatus())
+ for c in all_containers]
+ else:
+ # return list of compute nodes for specified DC
+ return [(c.name, c.getStatus())
+ for c in self.dcs.get(dc_name).listCompute()]
+ except Exception as ex:
+ logging.exception("RPC error.")
+ return ex.message