X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2Fvim-emu.git;a=blobdiff_plain;f=emuvim%2Fapi%2Fzerorpcapi.py;fp=emuvim%2Fapi%2Fzerorpcapi.py;h=ecf822cd1b3f87432ac8e4d75a79a63dc8a4119c;hp=28519c6b4cdf8a1aced1433b9e155b607f6a2b88;hb=2ec74e1b51575358297374272edd2b9562210ee5;hpb=5831076971df3aeec3ecbd3d972557709ab27a4f diff --git a/emuvim/api/zerorpcapi.py b/emuvim/api/zerorpcapi.py index 28519c6..ecf822c 100644 --- a/emuvim/api/zerorpcapi.py +++ b/emuvim/api/zerorpcapi.py @@ -76,8 +76,17 @@ class MultiDatacenterApi(object): def compute_list(self, dc_name): logging.info("RPC CALL: compute list") try: - return [(c.name, c.IP()) - for c in self.dcs.get(dc_name).listCompute()] + 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