From 1719bc40e091bec7c6069e5a7c293e95c3080051 Mon Sep 17 00:00:00 2001 From: stevenvanrossem Date: Thu, 12 May 2016 11:52:08 +0200 Subject: [PATCH] minor cleanups --- src/emuvim/cli/network.py | 7 ++++--- src/emuvim/dcemulator/net.py | 1 - src/emuvim/examples/monitoring_demo_topology.py | 7 ++++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/emuvim/cli/network.py b/src/emuvim/cli/network.py index 53007cd..516a752 100755 --- a/src/emuvim/cli/network.py +++ b/src/emuvim/cli/network.py @@ -84,7 +84,8 @@ class ZeroRpcClient(object): parser = argparse.ArgumentParser(description='son-emu network') parser.add_argument( "command", - help="Action to be executed: add|remove") + choices=['add', 'remove'], + help="Action to be executed.") parser.add_argument( "--datacenter", "-d", dest="datacenter", help="Data center to in which the network action should be initiated") @@ -103,10 +104,10 @@ parser.add_argument( parser.add_argument( "--bidirectional", "-b", dest="bidirectional", action='store_true', - help="add/remove the flow entries in 2 directions") + help="add/remove the flow entries from src to dst and back") parser.add_argument( "--cookie", "-c", dest="cookie", - help="cookie for this flow") + help="cookie for this flow, as easy to use identifier (eg. per tenant/service)") def main(argv): args = vars(parser.parse_args(argv)) diff --git a/src/emuvim/dcemulator/net.py b/src/emuvim/dcemulator/net.py index 3556535..f5bab44 100755 --- a/src/emuvim/dcemulator/net.py +++ b/src/emuvim/dcemulator/net.py @@ -479,7 +479,6 @@ class DCNetwork(Containernet): self.ryu_process.kill() def ryu_REST(self, prefix, dpid=None, data=None): - if data: logging.info('log POST: {0}'.format(str(data))) try: if dpid: url = self.ryu_REST_api + '/' + str(prefix) + '/' + str(dpid) diff --git a/src/emuvim/examples/monitoring_demo_topology.py b/src/emuvim/examples/monitoring_demo_topology.py index 4dfd5b7..0650be4 100755 --- a/src/emuvim/examples/monitoring_demo_topology.py +++ b/src/emuvim/examples/monitoring_demo_topology.py @@ -32,11 +32,16 @@ def create_topology1(): net = DCNetwork(monitor=True, enable_learning=False) """ - 1b. add a monitoring agent to the DCNetwork + 1b. Add endpoint APIs for the whole DCNetwork, + to access and control the networking from outside. + e.g., to setup forwarding paths between compute + instances aka. VNFs (represented by Docker containers), passing through + different switches and datacenters of the emulated topology """ mon_api = ZeroRpcApiEndpointDCNetwork("0.0.0.0", 5151) mon_api.connectDCNetwork(net) mon_api.start() + """ 2. Add (logical) data centers to the topology (each data center is one "bigswitch" in our simplified -- 2.17.1