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

Method process_ipaliases

systemvm/debian/opt/cloud/bin/merge.py:258–281  ·  view source on GitHub ↗
(self, dbag)

Source from the content-addressed store, hash-verified

256 return dbag
257
258 def process_ipaliases(self, dbag):
259 nic_dev = None
260 # Should be a way to deal with this better
261 for intf, data in list(dbag.items()):
262 if intf == 'id':
263 continue
264 elif any([net['nw_type'] == 'guest' for net in data]):
265 nic_dev = intf
266 break
267
268 assert nic_dev is not None, 'Unable to determine Guest interface'
269
270 nic_dev_id = nic_dev[3:]
271
272 for alias in self.qFile.data['aliases']:
273 ip = {
274 'add': not alias['revoke'],
275 'nw_type': 'guest',
276 'public_ip': alias['ip_address'],
277 'netmask': alias['netmask'],
278 'nic_dev_id': nic_dev_id
279 }
280 dbag = cs_ip.merge(dbag, ip)
281 return dbag
282
283
284class QueueFile:

Callers 1

processMethod · 0.95

Calls 1

anyFunction · 0.85

Tested by

no test coverage detected