+ r = self.c.compute_list(
+ args.get("datacenter"))
+ table = []
+ for c in r:
+ # for each container add a line to the output table
+ if len(c) > 1:
+ name = c[0]
+ status = c[1]
+ eth0ip = None
+ eth0status = "down"
+ if len(status.get("network")) > 0:
+ eth0ip = status.get("network")[0][1]
+ eth0status = "up" if status.get(
+ "network")[0][3] else "down"
+ table.append([status.get("datacenter"),
+ name,
+ status.get("image"),
+ eth0ip,
+ eth0status,
+ status.get("state").get("Status")])
+ headers = ["Datacenter",
+ "Container",
+ "Image",
+ "eth0 IP",
+ "eth0 status",
+ "Status"]
+ print tabulate(table, headers=headers, tablefmt="grid")