...
 
Commits (2)
......@@ -119,8 +119,8 @@ class Action(Resource):
NL_KEYS = [ "family" ]
OTHER_KEYS = []
def __init__(self,family=None):
self.matches = {}
def __init__(self,family=None, matches=None):
self.matches = {} if matches is None else matches
self.family = family
def add_match(self,match_id):
......@@ -141,8 +141,8 @@ class RouteAction(Action):
])
OTHER_KEYS = []
def __init__(self,number=None,dst=None,dst_len=None,gateway=None,oif=None,family=socket.AF_INET):
super(RouteAction,self).__init__(family=family)
def __init__(self,number=None,dst=None,dst_len=None,gateway=None,oif=None,family=socket.AF_INET, matches=None):
super(RouteAction,self).__init__(family=family, matches=matches)
self.number = number
self.dst = dst
self.dst_len = dst_len
......@@ -175,7 +175,7 @@ class Seg6Action(RouteAction):
OTHER_KEYS = []
def __init__(self,number=None,dst=None,dst_len=None,gateway=None,oif=None,
family=socket.AF_INET,encap={}):
family=socket.AF_INET,matches=None,encap={}):
if not encap:
encap = {}
if 'mode' in encap \
......@@ -190,7 +190,7 @@ class Seg6Action(RouteAction):
if not 'type' in encap:
encap['type'] = 'seg6'
super(Seg6Action, self).__init__(
number=number,dst=dst,dst_len=dst_len,gateway=gateway,oif=oif,family=family)
number=number,dst=dst,dst_len=dst_len,gateway=gateway,oif=oif,family=family,matches=matches)
self.encap = encap
@property
......