if f == "PIFs":
# drop PIFs on other hosts
self.__networks[n][f] = [p for p in rec[f] if self.__pif_on_host(p)]
+ elif f == "MTU" and f not in rec:
+ # XenServer 5.5 network records did not have an
+ # MTU field, so allow this to be missing.
+ pass
else:
self.__networks[n][f] = rec[f]
self.__networks[n]['other_config'] = {}
def __init__(self, pif):
self._pif = pif
+ @classmethod
+ def rewrite(cls):
+ """Class method called when write action is called. Can be used
+ to update any backend specific configuration."""
+ pass
+
def configure_ipdev(self, cfg):
"""Write ifcfg TYPE field for an IPdev, plus any type specific
fields to cfg
"""
raise NotImplementedError
-def DatapathFactory(pif):
+def DatapathFactory():
# XXX Need a datapath object for bridgeless PIFs
try:
if network_backend == "bridge":
from InterfaceReconfigureBridge import DatapathBridge
- return DatapathBridge(pif)
- elif network_backend == "vswitch":
+ return DatapathBridge
+ elif network_backend in ["openvswitch", "vswitch"]:
from InterfaceReconfigureVswitch import DatapathVswitch
- return DatapathVswitch(pif)
+ return DatapathVswitch
else:
raise Error("unknown network backend %s" % network_backend)