(self, brName, dev)
| 364 | |
| 365 | |
| 366 | def addBridge(self, brName, dev): |
| 367 | bash("ifdown %s" % dev.name) |
| 368 | |
| 369 | if not os.path.exists(self.brCfgFile): |
| 370 | shutil.copy(self.devCfgFile, self.brCfgFile) |
| 371 | |
| 372 | cfo = configFileOps(self.devCfgFile, self) |
| 373 | cfo.addEntry("STARTMODE", "auto") |
| 374 | if self.syscfg.env.bridgeType == "openvswitch": |
| 375 | if cfo.getEntry("IPADDR"): |
| 376 | cfo.rmEntry("IPADDR", cfo.getEntry("IPADDR")) |
| 377 | elif self.syscfg.env.bridgeType == "native": |
| 378 | # Bridge is linked to the dev in SUSE not the other way round |
| 379 | pass |
| 380 | else: |
| 381 | raise CloudInternalException("Unknown network.bridge.type %s" % self.syscfg.env.bridgeType) |
| 382 | cfo.save() |
| 383 | |
| 384 | cfo = configFileOps(self.brCfgFile, self) |
| 385 | cfo.addEntry("STARTMODE", "auto") |
| 386 | if self.syscfg.env.bridgeType == "openvswitch": |
| 387 | if cfo.getEntry("LLADDR"): |
| 388 | cfo.rmEntry("LLADDR", cfo.getEntry("LLADDR")) |
| 389 | cfo.addEntry("BRIDGE_STP", "yes") |
| 390 | cfo.addEntry("OVS_BRIDGE", "yes") |
| 391 | elif self.syscfg.env.bridgeType == "native": |
| 392 | cfo.addEntry("BRIDGE", "yes") |
| 393 | else: |
| 394 | raise CloudInternalException("Unknown network.bridge.type %s" % self.syscfg.env.bridgeType) |
| 395 | # Bridge is linked to the dev in SUSE not the other way round |
| 396 | cfo.addEntry("BRIDGE_PORTS", dev.name) |
| 397 | cfo.save() |
| 398 | |
| 399 | def config(self): |
| 400 | try: |
no test coverage detected