From 18344140bd0aae61dd6f50667d719cd9cfe149cb Mon Sep 17 00:00:00 2001 From: James Page Date: Thu, 1 Oct 2015 11:54:28 +0100 Subject: [PATCH] Use format to convert ints to strings This ensures that on 32bit architectures, where sometimes an implicit long is created, the resulting string does not contain a 'L' suffix as generated by the hex function. Change-Id: I264f90d68009963fe7a217c2170e1cf2f46ae2bb Closes-Bug: 1501703 (cherry picked from commit 49883f1b2bfc9a4f06b1d336553d7f0ab4289a0d) --- neutron/agent/linux/ip_lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neutron/agent/linux/ip_lib.py b/neutron/agent/linux/ip_lib.py index 551341a18..b0ae964ef 100644 --- a/neutron/agent/linux/ip_lib.py +++ b/neutron/agent/linux/ip_lib.py @@ -331,7 +331,7 @@ class IpRuleCommand(IpCommandBase): integers.append(0xffffffff) # We now have two integers in a list. Convert to canonical string. - return '/'.join(map(hex, integers)) + return '{0:#x}/{1:#x}'.format(*integers) def canonicalize(item): k, v = item -- 2.45.2