#
def pif_rename_physical_devices(pif):
+ if pif_is_tunnel(pif):
+ return
if pif_is_vlan(pif):
pif = pif_get_vlan_slave(pif)
"""
pifrec = db().get_pif_record(pif)
- nwrec = db().get_network_record(pifrec['network'])
+ nw = pifrec['network']
+ nwrec = db().get_network_record(nw)
ipdev = pif_ipdev_name(pif)
if len(offload):
f.write("ETHTOOL_OFFLOAD_OPTS=\"%s\"\n" % str.join(" ", offload))
- mtu = mtu_setting(nwrec['other_config'])
- if mtu:
- f.write("MTU=%s\n" % mtu)
-
ipdev_configure_static_routes(ipdev, nwrec['other_config'], f)
+ mtu = mtu_setting(nw, "Network", nwrec['other_config'])
+ if mtu:
+ f.write("MTU=%s\n" % mtu)
+
+
if pifrec.has_key('DNS') and pifrec['DNS'] != "":
ServerList = pifrec['DNS'].split(",")
for i in range(len(ServerList)): f.write("DNS%d=%s\n" % (i+1, ServerList[i]))
pifrec = db().get_pif_record(pif)
ipdev = pif_ipdev_name(pif)
- dp = DatapathFactory(pif)
+ dp = DatapathFactory()(pif)
log("action_up: %s" % ipdev)
def action_down(pif):
ipdev = pif_ipdev_name(pif)
- dp = DatapathFactory(pif)
+ dp = DatapathFactory()(pif)
log("action_down: %s" % ipdev)
dp.bring_down()
+def action_rewrite():
+ DatapathFactory().rewrite()
+
# This is useful for reconfiguring the mgmt interface after having lost connectivity to the pool master
def action_force_rewrite(bridge, config):
def getUUID():
pif = db().get_pif_by_uuid(pif_uuid)
if action == "rewrite":
- pass
+ action_rewrite()
else:
if not pif:
raise Usage("No PIF given")