(self, brName, dev)
| 345 | networkConfigBase.__init__(self, syscfg) |
| 346 | |
| 347 | def writeToCfgFile(self, brName, dev): |
| 348 | self.devCfgFile = "/etc/sysconfig/network/ifcfg-%s" % dev.name |
| 349 | self.brCfgFile = "/etc/sysconfig/network/ifcfg-%s" % brName |
| 350 | |
| 351 | isDevExist = os.path.exists(self.devCfgFile) |
| 352 | isBrExist = os.path.exists(self.brCfgFile) |
| 353 | if isDevExist and isBrExist: |
| 354 | logging.debug("%s:%s already configured"%(brName, dev.name)) |
| 355 | return True |
| 356 | elif isDevExist and not isBrExist: |
| 357 | #reconfig bridge |
| 358 | self.addBridge(brName, dev) |
| 359 | elif not isDevExist and isBrExist: |
| 360 | #reconfig dev |
| 361 | raise CloudInternalException("Missing device configuration, Need to add your network configuration into /etc/sysconfig/network-scripts at first") |
| 362 | else: |
| 363 | raise CloudInternalException("Missing bridge/device network configuration, need to add your network configuration into /etc/sysconfig/network-scripts at first") |
| 364 | |
| 365 | |
| 366 | def addBridge(self, brName, dev): |
nothing calls this directly
no test coverage detected