]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Use format to convert ints to strings
authorJames Page <james.page@ubuntu.com>
Thu, 1 Oct 2015 10:54:28 +0000 (11:54 +0100)
committerKyle Mestery <mestery@mestery.com>
Fri, 2 Oct 2015 16:01:44 +0000 (16:01 +0000)
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

index 551341a181444f988955018f9d24f3e19517ea4c..b0ae964ef1723146e085cb6cdb96ed1b8f3ec04d 100644 (file)
@@ -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