diff options
author | Paul Vinciguerra <pvinci@vinciconsulting.com> | 2018-11-25 10:46:44 -0800 |
---|---|---|
committer | Ole Trøan <otroan@employees.org> | 2018-11-26 09:09:56 +0000 |
commit | 9db94454b979d54d9a4bbaeb335582adacba9943 (patch) | |
tree | 7cd6f5844d205246367438cd4aea2914a70dfd5b /test/test_l2bd_arp_term.py | |
parent | 86ebba6b3f99bb672126338ac3f549978b5ef01d (diff) |
VPP-1508 python3 tests locals()
Do not use locals() for string formatting.
Change-Id: I2e811f479198159b4005fa69c09ad903944d8ae3
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'test/test_l2bd_arp_term.py')
-rw-r--r-- | test/test_l2bd_arp_term.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/test_l2bd_arp_term.py b/test/test_l2bd_arp_term.py index 23742b17f85..92942d38789 100644 --- a/test/test_l2bd_arp_term.py +++ b/test/test_l2bd_arp_term.py @@ -156,12 +156,13 @@ class TestL2bdArpTerm(VppTestCase): def arp_resp_hosts(self, src_host, pkts): return {self.arp_resp_host(src_host, p) for p in pkts} - def inttoip4(self, ip): + @staticmethod + def inttoip4(ip): o1 = int(ip / 16777216) % 256 o2 = int(ip / 65536) % 256 o3 = int(ip / 256) % 256 o4 = int(ip) % 256 - return '%(o1)s.%(o2)s.%(o3)s.%(o4)s' % locals() + return '%s.%s.%s.%s' % (o1, o2, o3, o4) def arp_event_host(self, e): return Host(mac=':'.join(['%02x' % ord(char) for char in e.new_mac]), |