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

Function network_rules_vmSecondaryIp

scripts/vm/network/security_group.py:469–488  ·  view source on GitHub ↗
(vm_name, vm_mac, ip_secondary, action)

Source from the content-addressed store, hash-verified

467
468
469def network_rules_vmSecondaryIp(vm_name, vm_mac, ip_secondary, action):
470 logging.debug("vmName = "+ vm_name)
471 logging.debug("vmMac = " + vm_mac)
472 logging.debug("action = "+ action)
473
474 vmchain = vm_name
475 vmchain6 = vmchain + '-6'
476
477 ip4s, ip6s = split_ips_by_family(ip_secondary)
478
479 add_to_ipset(vmchain, ip4s, action)
480
481 #add ipv6 addresses to ipv6 ipset
482 add_to_ipset(vmchain6, ip6s, action)
483
484 #add ebtables rules for the secondary ip
485 refactor_ebtable_rules(vm_name)
486 ebtables_rules_vmip(vm_name, vm_mac, [ip_secondary], action)
487
488 return True
489
490def ebtables_rules_vmip (vmname, vmmac, ips, action):
491 eb_vm_chain=ebtables_chain_name(vmname)

Callers 1

security_group.pyFile · 0.85

Calls 5

split_ips_by_familyFunction · 0.85
add_to_ipsetFunction · 0.85
refactor_ebtable_rulesFunction · 0.85
ebtables_rules_vmipFunction · 0.85
debugMethod · 0.80

Tested by

no test coverage detected