summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Larson <slioch@slioch.vyatta.com>2010-06-11 15:18:49 -0700
committerMichael Larson <slioch@slioch.vyatta.com>2010-06-11 15:18:49 -0700
commit73c67f002d23618dd879ce68bb0c105427422de8 (patch)
tree5ae670e8e433f5c78ec005ed78e83e32e68bd4f8
parentee5e4fb5ba06385bfd36c93eaa9cb7891c266c8e (diff)
parentf72bec9dff2b62e9d3704676ec3a12cf1c85a09d (diff)
downloadvyatta-cfg-73c67f002d23618dd879ce68bb0c105427422de8.tar.gz
vyatta-cfg-73c67f002d23618dd879ce68bb0c105427422de8.zip
Merge branch 'larkspur' of http://git.vyatta.com/vyatta-cfg into larkspur
-rwxr-xr-xlib/Vyatta/Keepalived.pm20
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/Vyatta/Keepalived.pm b/lib/Vyatta/Keepalived.pm
index 6689f4a..dc7e71b 100755
--- a/lib/Vyatta/Keepalived.pm
+++ b/lib/Vyatta/Keepalived.pm
@@ -29,7 +29,7 @@ our @EXPORT = qw(get_conf_file get_state_script get_state_file
vrrp_log vrrp_get_init_state get_changes_file
start_daemon restart_daemon stop_daemon
vrrp_get_config list_vrrp_intf list_vrrp_group
- list_vrrp_sync_group);
+ list_vrrp_sync_group list_all_vrrp_sync_grps);
use base qw(Exporter);
use Vyatta::Config;
@@ -371,5 +371,23 @@ sub list_vrrp_sync_group {
return $sync_group;
}
+sub list_all_vrrp_sync_grps {
+ my @sync_grps = ();
+ 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) {
+ # add to sync_grps if not already there
+ if (scalar( grep( /^$sync_grp$/, @sync_grps ) ) == 0) {
+ push (@sync_grps, $sync_grp);
+ }
+ }
+ }
+ }
+ return @sync_grps;
+}
+
1;
#end of file