From: peusterm Date: Fri, 19 Aug 2016 06:49:39 +0000 (+0200) Subject: Fix: son-emu-cli compute list now simply prints the docker0 interfaces to have more... X-Git-Tag: v3.1~68^2~2 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=fa63aa9f4cb1c9c79c2555a93e2283a673300f9c;p=osm%2Fvim-emu.git Fix: son-emu-cli compute list now simply prints the docker0 interfaces to have more consistency. --- diff --git a/src/emuvim/cli/rest/compute.py b/src/emuvim/cli/rest/compute.py index cdc0b04..b92fd4f 100755 --- a/src/emuvim/cli/rest/compute.py +++ b/src/emuvim/cli/rest/compute.py @@ -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'],