Skip to content

Commit

Permalink
more readable regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
guillomovitch committed Aug 12, 2012
1 parent c02e26d commit 8935acc
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions lib/FusionInventory/Agent/Task/Inventory/Input/HPUX/Networks.pm
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,25 @@ sub _getNwmgrInfo {

my $info;
while (my $line = <$handle>) {
next unless $line =~ /^(\w+)\s+(\w+)\s+0x(\w{2})(\w{2})(\w{2})(\w{2})(\w{2})(\w{2})\s+(\w+)\s+(\w*)/x;
my $netif = $1;

$info->{$netif} = {
status => $2,
mac => join(':', ($3, $4, $5, $6, $7, $8)),
driver => $9,
media => $10,
related_if => $11

next unless $line =~ /^
(\w+)
\s+
(\w+)
\s+
0x($alt_mac_address_pattern)
\s+
(\w+)
\s+
(\w*)
/x;
my $interface = $1;

$info->{$interface} = {
status => $2,
mac => alt2canonical($3),
driver => $4,
media => $5,
related_if => undef
}
}
close $handle;
Expand Down

0 comments on commit 8935acc

Please sign in to comment.