diff options
author | Stig Thormodsrud <stig@vyatta.com> | 2011-01-24 19:56:41 -0800 |
---|---|---|
committer | Stig Thormodsrud <stig@vyatta.com> | 2011-01-24 19:56:41 -0800 |
commit | 92a4d11c73fa5bcd18b91a8a5c7e11ec2bf42ed1 (patch) | |
tree | 181752a90dc5f2bb2bdf35e790d721d8f7428ab3 /lib/Vyatta | |
parent | 34779615450e6585404d2ec8b78d4611d9ce8858 (diff) | |
download | vyatta-cfg-92a4d11c73fa5bcd18b91a8a5c7e11ec2bf42ed1.tar.gz vyatta-cfg-92a4d11c73fa5bcd18b91a8a5c7e11ec2bf42ed1.zip |
Fix 6501: "clear vrrp master interface <interface> group <group]id>" command doesnt work with sync groups
Diffstat (limited to 'lib/Vyatta')
-rwxr-xr-x | lib/Vyatta/Keepalived.pm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/Vyatta/Keepalived.pm b/lib/Vyatta/Keepalived.pm index 7ded8a5..28a6f53 100755 --- a/lib/Vyatta/Keepalived.pm +++ b/lib/Vyatta/Keepalived.pm @@ -30,6 +30,7 @@ our @EXPORT = qw(get_conf_file get_state_script get_state_file start_daemon restart_daemon stop_daemon vrrp_get_config list_vrrp_intf list_vrrp_group list_vrrp_sync_group list_all_vrrp_sync_grps + list_vrrp_sync_group_members vrrp_get_primary_addr); use base qw(Exporter); @@ -411,5 +412,21 @@ sub list_all_vrrp_sync_grps { return @sync_grps; } +sub list_vrrp_sync_group_members { + my ($sync_group) = @_; + my @members = (); + my @vrrp_intfs = list_vrrp_intf(); + foreach my $vrrp_intf (@vrrp_intfs) { + my @vrrp_groups = list_vrrp_group($vrrp_intf); + foreach my $vrrp_group (@vrrp_groups) { + my $sync_grp = list_vrrp_sync_group($vrrp_intf, $vrrp_group); + if (defined $sync_grp) { + push @members, 'vyatta-' . $vrrp_intf. '-' . $vrrp_group; + } + } + } + return @members; +} + 1; #end of file |