From b6d02c359796ac0c47a4214a2fee827ad5d61d47 Mon Sep 17 00:00:00 2001 From: Stig Thormodsrud Date: Sun, 1 Nov 2009 09:58:19 -0800 Subject: Convert keepalived to use Interface infrastructure. --- lib/Vyatta/Keepalived.pm | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'lib') diff --git a/lib/Vyatta/Keepalived.pm b/lib/Vyatta/Keepalived.pm index c34d277..13966c5 100755 --- a/lib/Vyatta/Keepalived.pm +++ b/lib/Vyatta/Keepalived.pm @@ -152,21 +152,11 @@ sub vrrp_get_config { my $path; my $config = new Vyatta::Config; - - if ($intf =~ m/bond/) { - if ($intf =~ m/(bond\d+)\.(\d+)/) { - $path = "interfaces bonding $1 vif $2"; - } else { - $path = "interfaces bonding $intf"; - } - } else { - if ($intf =~ m/(eth\d+)\.(\d+)/) { - $path = "interfaces ethernet $1 vif $2"; - } else { - $path = "interfaces ethernet $intf"; - } - } + my $interface = new Vyatta::Interface($intf); + die "Unknown interface type: $intf" unless $interface; + + $path = $interface->path(); $config->setLevel($path); my $primary_addr = $config->returnOrigValue("address"); if (!defined $primary_addr) { -- cgit v1.2.3