Code Review
/
csit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix Acl Plugin tests after update of Acl models
[csit.git]
/
resources
/
libraries
/
python
/
honeycomb
/
HcAPIKwACL.py
diff --git
a/resources/libraries/python/honeycomb/HcAPIKwACL.py
b/resources/libraries/python/honeycomb/HcAPIKwACL.py
index
556c396
..
19cdb37
100644
(file)
--- a/
resources/libraries/python/honeycomb/HcAPIKwACL.py
+++ b/
resources/libraries/python/honeycomb/HcAPIKwACL.py
@@
-1,4
+1,4
@@
-# Copyright (c) 201
6
Cisco and/or its affiliates.
+# Copyright (c) 201
8
Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
@@
-50,7
+50,7
@@
class ACLKeywords(object):
:returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If the status code in response to PUT is not
:returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If the status code in response to PUT is not
- 200 = OK.
+
200 = OK.
"""
if data:
"""
if data:
@@
-266,16
+266,12
@@
class ACLKeywords(object):
:type list_name: str
:type data: dict
:type macip: bool
:type list_name: str
:type data: dict
:type macip: bool
-
:returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If the operation fails.
"""
:returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If the operation fails.
"""
- if macip:
- path = "/acl/vpp-acl:vpp-macip-acl/{0}".format(list_name)
- else:
- path = "/acl/vpp-acl:vpp-acl/{0}".format(list_name)
+ path = "/acl/{0}".format(list_name)
status_code, resp = HcUtil.put_honeycomb_data(
node, "config_plugin_acl", data, path)
status_code, resp = HcUtil.put_honeycomb_data(
node, "config_plugin_acl", data, path)
@@
-296,14
+292,13
@@
class ACLKeywords(object):
:param interface: Name of an interface on the node.
:param acl_name: Name of an ACL chain configured through ACL-plugin.
:param direction: Classify incoming or outgiong packets.
:param interface: Name of an interface on the node.
:param acl_name: Name of an ACL chain configured through ACL-plugin.
:param direction: Classify incoming or outgiong packets.
- Valid options are: ingress, egress
+
Valid options are: ingress, egress
:param macip: Use simple MAC+IP classifier. Optional.
:type node: dict
:type interface: str or int
:type acl_name: str
:type direction: str
:type macip: bool
:param macip: Use simple MAC+IP classifier. Optional.
:type node: dict
:type interface: str or int
:type acl_name: str
:type direction: str
:type macip: bool
-
:returns: Content of response.
:rtype: bytearray
:raises ValueError: If the direction argument is incorrect.
:returns: Content of response.
:rtype: bytearray
:raises ValueError: If the direction argument is incorrect.
@@
-320,32
+315,19
@@
class ACLKeywords(object):
"Valid options are: ingress, egress."
.format(direction))
"Valid options are: ingress, egress."
.format(direction))
- path = "/
interface/{0}/interface-acl:acl/{1}
".format(
+ path = "/
attachment-points/interface/{0}/{1}/acl-sets/
".format(
interface, direction)
interface, direction)
- if macip:
- data = {
- direction: {
- "vpp-macip-acl": {
- "type": "vpp-acl:vpp-macip-acl",
- "name": acl_name
- }
- }
- }
- else:
- data = {
- direction: {
- "vpp-acls": [
- {
- "type": "vpp-acl:vpp-acl",
- "name": acl_name
- }
- ]
+ data = {
+ "acl-sets": {
+ "acl-set": {
+ "name": acl_name
}
}
}
}
+ }
status_code, resp = HcUtil.put_honeycomb_data(
status_code, resp = HcUtil.put_honeycomb_data(
- node, "config_
vpp_interfaces
", data, path)
+ node, "config_
plugin_acl
", data, path)
if status_code not in (HTTPCodes.OK, HTTPCodes.ACCEPTED):
raise HoneycombError(
if status_code not in (HTTPCodes.OK, HTTPCodes.ACCEPTED):
raise HoneycombError(
@@
-369,9
+351,9
@@
class ACLKeywords(object):
interface = interface.replace("/", "%2F")
interface = interface.replace("/", "%2F")
- path = "/
interface/{0}/interface-acl:acl
/".format(interface)
+ path = "/
attachment-points/interface/{0}
/".format(interface)
status_code, _ = HcUtil.delete_honeycomb_data(
status_code, _ = HcUtil.delete_honeycomb_data(
- node, "config_
vpp_interfaces
", path)
+ node, "config_
plugin_acl
", path)
if status_code != HTTPCodes.OK:
raise HoneycombError(
if status_code != HTTPCodes.OK:
raise HoneycombError(