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

Method config

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

Source from the content-addressed store, hash-verified

203 raise CloudInternalException("Missing bridge/device network configuration, need to add your network configuration into /etc/network/interfaces at first")
204
205 def config(self):
206 try:
207 if super(networkConfigUbuntu, self).isPreConfiged():
208 return True
209
210 self.netMgrRunning = self.syscfg.svo.isServiceRunning("network-manager")
211 super(networkConfigUbuntu, self).cfgNetwork()
212 if self.netMgrRunning:
213 self.syscfg.svo.stopService("network-manager")
214 self.syscfg.svo.disableService("network-manager")
215
216 ifup_op = bash("ifup %s"%self.brName)
217 if not ifup_op.isSuccess():
218 raise CloudInternalException("Can't start network:%s %s" % (self.brName, ifup_op.getErrMsg()))
219
220 self.syscfg.env.nics.append(self.brName)
221 self.syscfg.env.nics.append(self.brName)
222 self.syscfg.env.nics.append(self.brName)
223 return True
224 except:
225 raise
226
227 def restore(self):
228 try:

Callers

nothing calls this directly

Calls 10

bashClass · 0.85
isPreConfigedMethod · 0.80
cfgNetworkMethod · 0.80
getErrMsgMethod · 0.80
isSuccessMethod · 0.65
isServiceRunningMethod · 0.45
stopServiceMethod · 0.45
disableServiceMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected