MCPcopy Create free account
hub / github.com/apache/cloudstack / config

Method config

python/lib/cloudutils/serviceConfig.py:304–329  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

302 cfo.save()
303
304 def config(self):
305 try:
306 if super(networkConfigRedhat, self).isPreConfiged():
307 return True
308
309 super(networkConfigRedhat, self).cfgNetwork()
310
311 self.netMgrRunning = self.syscfg.svo.isServiceRunning("NetworkManager")
312 if self.netMgrRunning:
313 self.syscfg.svo.stopService("NetworkManager")
314 self.syscfg.svo.disableService("NetworkManager")
315
316 cfo = configFileOps("/etc/sysconfig/network", self)
317 cfo.addEntry("NOZEROCONF", "yes")
318 cfo.save()
319
320 if not bash("service network restart").isSuccess():
321 if not bash("systemctl restart NetworkManager.service").isSuccess():
322 raise CloudInternalException("Can't restart network")
323
324 self.syscfg.env.nics.append(self.brName)
325 self.syscfg.env.nics.append(self.brName)
326 self.syscfg.env.nics.append(self.brName)
327 return True
328 except:
329 raise
330
331 def restore(self):
332 try:

Callers

nothing calls this directly

Calls 12

configFileOpsClass · 0.90
bashClass · 0.85
isPreConfigedMethod · 0.80
cfgNetworkMethod · 0.80
saveMethod · 0.65
isSuccessMethod · 0.65
isServiceRunningMethod · 0.45
stopServiceMethod · 0.45
disableServiceMethod · 0.45
addEntryMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected