diff options
author | Paul Vinciguerra <pvinci@vinciconsulting.com> | 2020-04-03 12:18:40 -0400 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2020-04-06 11:30:05 +0000 |
commit | 582eac5c30e78f65ba0127aed2cb7442f4122fd2 (patch) | |
tree | 39ad2be057c49fcf9282eb05455e68ae3323ac17 /src/plugins/vrrp/test | |
parent | c17d6cfaf4fc66927f28af9d8d7cb8ce2a1d839c (diff) |
misc: fix python sonarcloud BLOCKER level issues
Fix of the top 11 python issues flagged as BLOCKER.
Ticket: VPP-1856
Type: fix
Change-Id: Icf4691e62f4a69d6ee196b6d6e2ab52d961b5c76
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'src/plugins/vrrp/test')
-rw-r--r-- | src/plugins/vrrp/test/test_vrrp.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/vrrp/test/test_vrrp.py b/src/plugins/vrrp/test/test_vrrp.py index cd2aeb10ec3..3a85d2e6b66 100644 --- a/src/plugins/vrrp/test/test_vrrp.py +++ b/src/plugins/vrrp/test/test_vrrp.py @@ -8,12 +8,13 @@ import unittest import time -from socket import inet_pton, inet_ntop, AF_INET6 +import socket +from socket import inet_pton, inet_ntop from vpp_object import VppObject from vpp_papi import VppEnum -from scapy.packet import Raw +from scapy.packet import raw from scapy.layers.l2 import Ether, ARP from scapy.layers.inet import IP, ICMP, icmptypes from scapy.layers.inet6 import IPv6, ipv6nh, IPv6ExtHdrHopByHop, \ @@ -833,8 +834,8 @@ class TestVRRP6(VppTestCase): self.assertEqual(pkt[IPv6].dst, "ff02::1") # convert addrs to packed format since string versions could differ - src_addr = inet_pton(AF_INET6, pkt[IPv6].src) - vr_ll_addr = inet_pton(AF_INET6, vr.interface().local_ip6_ll) + src_addr = inet_pton(socket.AF_INET6, pkt[IPv6].src) + vr_ll_addr = inet_pton(socket.AF_INET6, vr.interface().local_ip6_ll) self.assertEqual(src_addr, vr_ll_addr) self.assertTrue(pkt[ICMPv6ND_NA].tgt in vr.virtual_ips()) |