Fix: son-emu-cli compute list now simply prints the docker0 interfaces to have more...
authorpeusterm <manuel.peuster@uni-paderborn.de>
Fri, 19 Aug 2016 06:49:39 +0000 (08:49 +0200)
committerpeusterm <manuel.peuster@uni-paderborn.de>
Fri, 19 Aug 2016 06:49:39 +0000 (08:49 +0200)
src/emuvim/cli/rest/compute.py

index cdc0b04..b92fd4f 100755 (executable)
@@ -77,24 +77,17 @@ class RestApiClient():
             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].get("ip")
-                    eth0status = "up" if status.get(
-                        "network")[0].get("up") else "down"
+                eth0ip = status.get("docker_network", "-")
                 table.append([status.get("datacenter"),
                               name,
                               status.get("image"),
                               eth0ip,
-                              eth0status,
                               status.get("state").get("Status")])
 
         headers = ["Datacenter",
                    "Container",
                    "Image",
-                   "eth0 IP",
-                   "eth0 status",
+                   "docker0",
                    "Status"]
         print(tabulate(table, headers=headers, tablefmt="grid"))
 
@@ -108,7 +101,13 @@ class RestApiClient():
         pp.pprint(list)
 
 
-parser = argparse.ArgumentParser(description='son-emu compute')
+parser = argparse.ArgumentParser(description="""son-emu compute
+    
+    Examples:
+    - son-emu-cli compute start -d dc2 -n client -i sonatanfv/sonata-iperf3-vnf
+    - son-emu-cli list
+    - son-emu-cli compute status -d dc2 -n client
+    """, formatter_class=argparse.RawTextHelpFormatter)
 parser.add_argument(
     "command",
     choices=['start', 'stop', 'list', 'status'],