extra match field for SDN chaining commands
diff --git a/src/emuvim/api/zerorpc/network.py b/src/emuvim/api/zerorpc/network.py
index e5d5ca0..e80ceef 100644
--- a/src/emuvim/api/zerorpc/network.py
+++ b/src/emuvim/api/zerorpc/network.py
@@ -81,7 +81,7 @@
logging.exception("RPC error.")
return ex.message
- def network_action_stop(self, vnf_src_name, vnf_dst_name, vnf_src_interface=None, vnf_dst_interface=None, weight=None):
+ def network_action_stop(self, vnf_src_name, vnf_dst_name, kwargs):
# call DCNetwork method, not really datacenter specific API for now...
# provided dc name needs to be part of API endpoint
# no check if vnfs are really connected to this datacenter...
@@ -89,10 +89,11 @@
try:
c = self.net.setChain(
vnf_src_name, vnf_dst_name,
- vnf_src_interface=vnf_src_interface,
- vnf_dst_interface=vnf_dst_interface,
+ vnf_src_interface=kwargs.get('vnf_src_interface'),
+ vnf_dst_interface=kwargs.get('vnf_dst_interface'),
cmd='del-flows',
- weight=weight)
+ weight=kwargs.get('weight'),
+ match=kwargs.get('match'))
return c
except Exception as ex:
logging.exception("RPC error.")
diff --git a/src/emuvim/cli/network.py b/src/emuvim/cli/network.py
index 5fa9993..bf107e8 100755
--- a/src/emuvim/cli/network.py
+++ b/src/emuvim/cli/network.py
@@ -47,19 +47,19 @@
def remove(self, args):
vnf_src_name = self._parse_vnf_name(args.get("source"))
- vnf_src_interface = self._parse_vnf_interface(args.get("source"))
vnf_dst_name = self._parse_vnf_name(args.get("destination"))
- vnf_dst_interface = self._parse_vnf_interface(args.get("destination"))
- weight = args.get("weight")
- match = args.get("match")
+
+ params = self._create_dict(
+ vnf_src_interface=self._parse_vnf_interface(args.get("source")),
+ vnf_dst_interface=self._parse_vnf_interface(args.get("destination")),
+ weight=args.get("weight"),
+ match=args.get("match"))
+
r = self.c.network_action_stop(
#args.get("datacenter"),
vnf_src_name,
vnf_dst_name,
- vnf_src_interface,
- vnf_dst_interface,
- weight,
- match)
+ params)
pp.pprint(r)
def _parse_vnf_name(self, vnf_name_str):
diff --git a/src/emuvim/dcemulator/net.py b/src/emuvim/dcemulator/net.py
index ec42b66..794d50e 100755
--- a/src/emuvim/dcemulator/net.py
+++ b/src/emuvim/dcemulator/net.py
@@ -309,7 +309,7 @@
match = 'in_port=%s' % switch_inport_nr
#add additional match entries from the argument
match_input = kwargs.get('match')
- logging.info('match input:{0}'.format(match_input))
+ #logging.info('match input:{0}'.format(match_input))
if match_input:
s = ','
match = s.join([match,match_input])