diff options
author | pmikus <pmikus@cisco.com> | 2021-10-08 08:54:21 +0000 |
---|---|---|
committer | Peter Mikus <pmikus@cisco.com> | 2021-10-08 11:37:48 +0000 |
commit | bd15bb418bf618ff3055fb25c339778d12c1eaef (patch) | |
tree | 175532e95acb25fbae5710f0a4d6d2d03bf784eb /resources/libraries/python/IPsecUtil.py | |
parent | 68f8548a9769aa55de77176c58e9e70bd1a88742 (diff) |
fix(Pylint): Small fixes
+ Just few obvious one
Signed-off-by: pmikus <pmikus@cisco.com>
Change-Id: I9bbac293a56d6b2943bef03cb3b8943e967dae6b
Diffstat (limited to 'resources/libraries/python/IPsecUtil.py')
-rw-r--r-- | resources/libraries/python/IPsecUtil.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/resources/libraries/python/IPsecUtil.py b/resources/libraries/python/IPsecUtil.py index acae5bd91d..e455dd7a88 100644 --- a/resources/libraries/python/IPsecUtil.py +++ b/resources/libraries/python/IPsecUtil.py @@ -787,11 +787,11 @@ class IPsecUtil: :type action: IPsecUtil.PolicyAction :type inbound: bool :type bidirectional: bool - :raises NotImplemented: When the action is PolicyAction.PROTECT. + :raises NotImplementedError: When the action is PolicyAction.PROTECT. """ if action == PolicyAction.PROTECT: - raise NotImplemented('Policy action PROTECT is not supported.') + raise NotImplementedError('Policy action PROTECT is not supported.') spd_id_dir1 = 1 spd_id_dir2 = 2 @@ -1014,7 +1014,7 @@ class IPsecUtil: tmp_filename = f"/tmp/ipsec_spd_{spd_id}_add_del_entry.script" with open(tmp_filename, 'w') as tmp_file: - for i in range(n_entries): + for _ in range(n_entries): direction = u'inbound' if inbound else u'outbound' sa = f' sa {sa_id.inc_fmt()}' if sa_id is not None else '' protocol = f' protocol {protocol}' if proto else '' @@ -1041,7 +1041,7 @@ class IPsecUtil: os.remove(tmp_filename) return - for i in range(n_entries): + for _ in range(n_entries): IPsecUtil.vpp_ipsec_add_spd_entry( node, spd_id, next(priority), action, inbound, next(sa_id) if sa_id is not None else sa_id, @@ -2208,7 +2208,8 @@ class IPsecUtil: crypto_key, integ_alg, integ_key, tunnel_ip1, tunnel_ip2 ) IPsecUtil.vpp_ipsec_add_spd_entries( - nodes[u"DUT2"], n_tunnels, spd_id, priority=ObjIncrement(p_lo, 0), + nodes[u"DUT2"], n_tunnels, spd_id, + priority=ObjIncrement(p_lo, 0), action=PolicyAction.PROTECT, inbound=True, sa_id=ObjIncrement(sa_id_1, 1), raddr_range=NetworkIncrement(ip_network(raddr_ip2)) @@ -2219,7 +2220,8 @@ class IPsecUtil: crypto_key, integ_alg, integ_key, tunnel_ip2, tunnel_ip1 ) IPsecUtil.vpp_ipsec_add_spd_entries( - nodes[u"DUT2"], n_tunnels, spd_id, priority=ObjIncrement(p_lo, 0), + nodes[u"DUT2"], n_tunnels, spd_id, + priority=ObjIncrement(p_lo, 0), action=PolicyAction.PROTECT, inbound=False, sa_id=ObjIncrement(sa_id_2, 1), raddr_range=NetworkIncrement(ip_network(raddr_ip1)) |