(vm_name, vm_mac, ip_secondary, action)
| 467 | |
| 468 | |
| 469 | def 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 | |
| 490 | def ebtables_rules_vmip (vmname, vmmac, ips, action): |
| 491 | eb_vm_chain=ebtables_chain_name(vmname) |
no test coverage detected