X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=csit%2Flibraries%2FSxp.py;h=5500c8fcf01067bd1d8a78e8b716478f67f6869e;hb=1450d8a59ff94e9f1252563cb19a863bc74c4919;hp=720871e581c03abc635ff2814d873f9ae661c041;hpb=f3686e7906e9751b4938882b6de4203c9c545cba;p=integration%2Ftest.git diff --git a/csit/libraries/Sxp.py b/csit/libraries/Sxp.py index 720871e581..5500c8fcf0 100644 --- a/csit/libraries/Sxp.py +++ b/csit/libraries/Sxp.py @@ -744,7 +744,7 @@ def get_peer_groups_from_node_xml(ip): return data -def add_filter_xml(group, filter_type, entries, ip): +def add_filter_xml(group, filter_type, entries, ip, policy=None): """Generate xml for Add Filter request :param group: Name of group containing filter @@ -755,18 +755,25 @@ def add_filter_xml(group, filter_type, entries, ip): :type entries: string :param ip: Ipv4 address of node :type ip: string + :param policy: Policy of filter update mechanism + :type policy: string :returns: String containing xml data for request """ + if policy: + policy = "" + policy + "" + else: + policy = "" templ = Template(''' $ip $group + $filter_policy $filter_type$entries ''') data = templ.substitute( - {'group': group, 'filter_type': filter_type, 'ip': ip, 'entries': entries}) + {'group': group, 'filter_type': filter_type, 'ip': ip, 'entries': entries, 'filter_policy': policy}) return data @@ -1056,7 +1063,7 @@ def prefix_range(start, end): index = 0 prefixes = '' while index < end: - prefixes += get_ip_from_number(index, start) + '/32' + prefixes += get_ip_from_number(index + start) + '/32' index += 1 if index < end: prefixes += ','