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

Method configure

systemvm/debian/opt/cloud/bin/cs/CsAddress.py:336–351  ·  view source on GitHub ↗
(self, address)

Source from the content-addressed store, hash-verified

334 return self.address
335
336 def configure(self, address):
337 # When "add" is false, it means that the IP has to be removed.
338 if address["add"]:
339 try:
340 logging.info("Configuring address %s on device %s", self.ip(), self.dev)
341 cmd = "ip addr add dev %s %s brd +" % (self.dev, self.ip())
342 CsHelper.execute(cmd)
343 cmd = "ifconfig %s mtu %s" % (self.dev, self.mtu())
344 CsHelper.execute(cmd)
345 except Exception as e:
346 logging.info("Exception occurred ==> %s" % e)
347
348 self.post_configure(address)
349 else:
350 # delete method performs post_configure, so no need to call post_configure here
351 self.delete(self.ip())
352
353 def post_configure(self, address):
354 """ The steps that must be done after a device is configured """

Callers 1

processMethod · 0.95

Calls 6

ipMethod · 0.95
mtuMethod · 0.95
post_configureMethod · 0.95
deleteMethod · 0.95
executeMethod · 0.65
infoMethod · 0.45

Tested by

no test coverage detected