summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2011-01-24 19:56:41 -0800
committerStig Thormodsrud <stig@vyatta.com>2011-01-25 11:15:36 -0800
commitdd0299eb8d0f1b807959a783013cca48c433114f (patch)
tree255b9cfebc9b6ca2ee567329aeb43dbe96330afc /lib
parent8e23ecc643ac8828477e3622eb6cc5786dbd3b07 (diff)
downloadvyatta-cfg-dd0299eb8d0f1b807959a783013cca48c433114f.tar.gz
vyatta-cfg-dd0299eb8d0f1b807959a783013cca48c433114f.zip
Fix 6501: "clear vrrp master interface <interface> group <group]id>" command doesnt work with sync groups
(cherry picked from commit 92a4d11c73fa5bcd18b91a8a5c7e11ec2bf42ed1)
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Vyatta/Keepalived.pm17
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