(dev, brName)
| 60 | |
| 61 | @staticmethod |
| 62 | def createBridge(dev, brName): |
| 63 | if not networkConfig.isBridgeSupported(): |
| 64 | logging.debug("bridge is not supported") |
| 65 | return False |
| 66 | if networkConfig.isBridgeEnslavedWithDevices(brName): |
| 67 | logging.debug("bridge: %s has devices enslaved"%brName) |
| 68 | return False |
| 69 | |
| 70 | cmds = "" |
| 71 | if not networkConfig.isBridge(brName): |
| 72 | cmds = "ip link add name %s type bridge ;"%brName |
| 73 | |
| 74 | cmds += "ifconfig %s up;"%brName |
| 75 | cmds += "ip link set dev %s master %s"%(dev, brName) |
| 76 | return bash(cmds).isSuccess() |
| 77 | |
| 78 | @staticmethod |
| 79 | def isBridgeEnslavedWithDevices(brName): |
nothing calls this directly
no test coverage detected