From 92a4d11c73fa5bcd18b91a8a5c7e11ec2bf42ed1 Mon Sep 17 00:00:00 2001 From: Stig Thormodsrud Date: Mon, 24 Jan 2011 19:56:41 -0800 Subject: Fix 6501: "clear vrrp master interface group " command doesnt work with sync groups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/Vyatta/Keepalived.pm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib') 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 -- cgit v1.2.3