diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-01-12 15:48:44 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-01-12 16:35:54 -0800 |
commit | 80f85801b57a030459cb6846bb229ca87d18cc5a (patch) | |
tree | 906ddae03b96176a50856153483d6e3a78eb3f86 /tests/interface.pl | |
parent | e12098cc7b7d44636a78e4d69983590a528438b5 (diff) | |
download | vyatta-cfg-80f85801b57a030459cb6846bb229ca87d18cc5a.tar.gz vyatta-cfg-80f85801b57a030459cb6846bb229ca87d18cc5a.zip |
Use new interfaces routines
Unify all code that does name -> interface attribute translation
into one place. No need to pass interface path to scripts, and handle
addresses correctly in DHCP code. Use 'undef' consitently for false
in perl code.
Diffstat (limited to 'tests/interface.pl')
-rw-r--r-- | tests/interface.pl | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/interface.pl b/tests/interface.pl index 5fe4278..989d6c5 100644 --- a/tests/interface.pl +++ b/tests/interface.pl @@ -19,12 +19,18 @@ foreach my $arg (@ARGV) { my $vif = $intf->vif(); print "vif=$vif " if $vif; - printf "path = '%s' device=%s\n", $intf->path(), $intf->physicalDevice(); + printf "path = '%s'\ndevice=%s\n", $intf->path(), $intf->physicalDevice(); - foreach my $attr (qw(exists configured disabled dhcp address up running)) { - my $val = $intf->$attr(); + my @addresses = $intf->address(); + if ($#addresses eq -1) { + print "address is no set\n"; + } else { + print "address ", join(' ',@addresses), "\n"; + } - if ($val) { + foreach my $attr (qw(exists configured disabled using up running)) { + my $val = $intf->$attr(); + if (defined $val) { print "\t$attr = $val\n"; } else { print "\t$attr is not set\n"; |