Config creation script (IP based): wrong IP in case of 10+ interfaces 26/5326/1
authorYaroslav Brustinov <[email protected]>
Thu, 22 Dec 2016 16:03:24 +0000 (18:03 +0200)
committerYaroslav Brustinov <[email protected]>
Thu, 22 Dec 2016 16:03:24 +0000 (18:03 +0200)
Change-Id: I71e861b9dcbc838d6344fa051cebacaa16e1fc54
Signed-off-by: Yaroslav Brustinov <[email protected]>
scripts/dpdk_setup_ports.py

index 3f24b24..2d8a046 100755 (executable)
@@ -698,11 +698,11 @@ Other network devices
                 if isinstance(ips, list) and len(ips) > i:
                     interface['ip'] = ips[i]
                 else:
-                    interface['ip'] = ".".join(list(str(i+1))*4)
+                    interface['ip'] = '.'.join([str(i+1) for _ in range(4)])
                 if isinstance(def_gws, list) and len(def_gws) > i:
                     interface['def_gw'] = def_gws[i]
                 else:
-                    interface['def_gw'] = ".".join(list(str(dual_index+1))*4)
+                    interface['def_gw'] = '.'.join([str(dual_index+1) for _ in range(4)])
             else:
                 dual_if = wanted_interfaces[dual_index]
                 if 'MAC' not in interface: