summaryrefslogtreecommitdiff
path: root/lib/Vyatta
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2009-11-01 09:58:19 -0800
committerStig Thormodsrud <stig@vyatta.com>2009-11-01 09:58:19 -0800
commitb6d02c359796ac0c47a4214a2fee827ad5d61d47 (patch)
tree0e0eca3d24b02d6637b4c58542501d5f8dcc9012 /lib/Vyatta
parent07219b06b85cf401a661075f289df5d01421b5c7 (diff)
downloadvyatta-cfg-b6d02c359796ac0c47a4214a2fee827ad5d61d47.tar.gz
vyatta-cfg-b6d02c359796ac0c47a4214a2fee827ad5d61d47.zip
Convert keepalived to use Interface infrastructure.
Diffstat (limited to 'lib/Vyatta')
-rwxr-xr-xlib/Vyatta/Keepalived.pm18
1 files changed, 4 insertions, 14 deletions
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) {