diff options
author | Stig Thormodsrud <stig@vyatta.com> | 2009-11-01 09:58:19 -0800 |
---|---|---|
committer | Stig Thormodsrud <stig@vyatta.com> | 2009-11-01 09:58:19 -0800 |
commit | b6d02c359796ac0c47a4214a2fee827ad5d61d47 (patch) | |
tree | 0e0eca3d24b02d6637b4c58542501d5f8dcc9012 /lib | |
parent | 07219b06b85cf401a661075f289df5d01421b5c7 (diff) | |
download | vyatta-cfg-b6d02c359796ac0c47a4214a2fee827ad5d61d47.tar.gz vyatta-cfg-b6d02c359796ac0c47a4214a2fee827ad5d61d47.zip |
Convert keepalived to use Interface infrastructure.
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/Vyatta/Keepalived.pm | 18 |
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) { |