diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-07-07 20:05:46 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-07-07 20:05:46 -0700 |
commit | b97267962689eed8dd11afecd2d160def3c93dc6 (patch) | |
tree | dc4062878098ffd9ac106231f75aed9380791222 /lib/Vyatta | |
parent | 812b774be535a198c032e7b553bb9eea04573a00 (diff) | |
download | vyatta-cfg-qos-b97267962689eed8dd11afecd2d160def3c93dc6.tar.gz vyatta-cfg-qos-b97267962689eed8dd11afecd2d160def3c93dc6.zip |
Fix error handling for rate limiter
If bandwidth not defined for rate limiter policy, the error message
should come from policy (not perl error checking).
Diffstat (limited to 'lib/Vyatta')
-rw-r--r-- | lib/Vyatta/Qos/RateLimiter.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Vyatta/Qos/RateLimiter.pm b/lib/Vyatta/Qos/RateLimiter.pm index ac0cd2c..d4b3f95 100644 --- a/lib/Vyatta/Qos/RateLimiter.pm +++ b/lib/Vyatta/Qos/RateLimiter.pm @@ -36,8 +36,9 @@ sub new { my $class = ref($that) || $that; my $self = {%fields}; - $self->{_rate} = getRate($config->returnValue("bandwidth")); - defined $self->{_rate} or die "$level bandwidth not defined\n"; + my $bw = config->returnValue("bandwidth"); + defined $bw or die "$level bandwidth not defined\n"; + $self->{_rate} = getRate($bw); $self->{_burst} = $config->returnValue("burst"); defined $self->{_burst} or die "$level burst not defined\n"; |