X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=src%2Femuvim%2Fcli%2Fcompute.py;h=0b3f38dd027729afbc3b12285a0731d03a9c7fa1;hb=a3ddebae7ff1346806d1a52abed12dae9969114f;hp=0cfb0240d184ed24e7750a0054fdf282e9022c6d;hpb=edcbeeba7236e852e1ff5b02c3704e0749dd3be3;p=osm%2Fvim-emu.git diff --git a/src/emuvim/cli/compute.py b/src/emuvim/cli/compute.py index 0cfb024..0b3f38d 100755 --- a/src/emuvim/cli/compute.py +++ b/src/emuvim/cli/compute.py @@ -15,7 +15,7 @@ pp = pprint.PrettyPrinter(indent=4) class ZeroRpcClient(object): def __init__(self): - self.c = zerorpc.Client() + self.c = zerorpc.Client(heartbeat=None, timeout=120) #heartbeat=None, timeout=120 self.c.connect("tcp://127.0.0.1:4242") # TODO hard coded for now. we'll change this later self.cmds = {} @@ -57,9 +57,9 @@ class ZeroRpcClient(object): eth0ip = None eth0status = "down" if len(status.get("network")) > 0: - eth0ip = status.get("network")[0][1] + eth0ip = status.get("network")[0].get("ip") eth0status = "up" if status.get( - "network")[0][3] else "down" + "network")[0].get("up") else "down" table.append([status.get("datacenter"), name, status.get("image"), @@ -90,13 +90,16 @@ class ZeroRpcClient(object): input=args.get("input"), output=args.get("output")) - r = self.c.compute_profile( + for output in self.c.compute_profile( args.get("datacenter"), args.get("name"), args.get("image"), params - ) - pp.pprint(r) + ): + print(output + '\n') + + #pp.pprint(r) + #print(r) def _create_dict(self, **kwargs): return kwargs