Exemple #1
0
    def addDataBridge(self, name, macStr, switchId, port):
        with MutexStore.getObjectLock(self.getLockIdentifier()):
            if self.networkInterfaces.filter(name=name,
                                             isBridge=True).count() > 0:
                raise Exception(
                    "Another data bridge with the same name already exists in this Server"
                )

            netInt = NetworkInterface.createServerDataBridge(
                name, macStr, switchId, port)
            self.networkInterfaces.add(netInt)
            self.autoSave()