X-Git-Url: http://git.onelab.eu/?p=pyplnet.git;a=blobdiff_plain;f=plnet.py;h=76e13073b670ee2d1b85cf866716211bdb988da8;hp=129e5bad09438c5da7351395403ae57b6f16ddfc;hb=04b1025cd00af3ecf4b0a7b49c849ca9e93cf8b9;hpb=b6b71094bb22b2ae358fb6e65396df9b151c3cdc diff --git a/plnet.py b/plnet.py index 129e5ba..76e1307 100755 --- a/plnet.py +++ b/plnet.py @@ -255,6 +255,7 @@ def InitInterfaces(logger, plc, data, root="", files_only=False, program="NodeMa # Process ifcfg-$dev changes / additions newdevs = [] + table = 10 for (dev, details) in devices_map.iteritems(): (fd, tmpnam) = tempfile.mkstemp(dir=sysconfig) f = os.fdopen(fd, "w") @@ -301,10 +302,7 @@ def InitInterfaces(logger, plc, data, root="", files_only=False, program="NodeMa src_route_changed = False if ('PRIMARY' not in details and 'GATEWAY' in details and details['GATEWAY'] != ''): - i = len(dev) - 1 - while dev[i - 1].isdigit(): - i -= 1 - table = 10 + int(dev[i:]) + table += 1 (fd, rule_tmpnam) = tempfile.mkstemp(dir=sysconfig) os.write(fd, "from %s lookup %d\n" % (details['IPADDR'], table)) os.close(fd)