Skip to content

Commit

Permalink
list context is now forced in message class
Browse files Browse the repository at this point in the history
  • Loading branch information
guillomovitch committed Jun 21, 2011
1 parent 255fb41 commit 135da79
Showing 1 changed file with 24 additions and 58 deletions.
82 changes: 24 additions & 58 deletions lib/FusionInventory/Agent/Task/NetDiscovery.pm
Expand Up @@ -145,73 +145,39 @@ sub run {
$iplist = &share({});
}

if (ref($options->{RANGEIP}) eq "HASH") {
if ($options->{RANGEIP}->{IPSTART} eq $options->{RANGEIP}->{IPEND}) {
foreach my $num (@{$options->{RANGEIP}}) {
if ($num->{IPSTART} eq $num->{IPEND}) {
if ($threads_run == 0) {
$iplist->{$countnb} = &share({});
}
$iplist->{$countnb}->{IP} = $options->{RANGEIP}->{IPSTART};
$iplist->{$countnb}->{ENTITY} = $options->{RANGEIP}->{ENTITY};
$iplist->{$countnb}->{IP} = $num->{IPSTART};
$iplist->{$countnb}->{ENTITY} = $num->{ENTITY};
$iplist2->{$countnb} = $countnb;
$countnb++;
$nbip++;
} else {
$ip = Net::IP->new($options->{RANGEIP}->{IPSTART}.' - '.$options->{RANGEIP}->{IPEND});
do {
if ($threads_run == 0) {
$iplist->{$countnb} = &share({});
}
$iplist->{$countnb}->{IP} = $ip->ip();
$iplist->{$countnb}->{ENTITY} = $options->{RANGEIP}->{ENTITY};
$iplist2->{$countnb} = $countnb;
$countnb++;
$nbip++;
if ($nbip eq $limitip) {
if ($ip->ip() ne $options->{RANGEIP}->{IPEND}) {
++$ip;
$options->{RANGEIP}->{IPSTART} = $ip->ip();
$loop_action = 1;
goto CONTINUE;
if ($num->{IPSTART} ne "") {
$ip = Net::IP->new($num->{IPSTART}.' - '.$num->{IPEND});
do {
if ($threads_run == 0) {
$iplist->{$countnb} = &share({});
}
}
} while (++$ip);
undef $options->{RANGEIP};
}
} else {
foreach my $num (@{$options->{RANGEIP}}) {
if ($num->{IPSTART} eq $num->{IPEND}) {
if ($threads_run == 0) {
$iplist->{$countnb} = &share({});
}
$iplist->{$countnb}->{IP} = $num->{IPSTART};
$iplist->{$countnb}->{ENTITY} = $num->{ENTITY};
$iplist2->{$countnb} = $countnb;
$countnb++;
$nbip++;
} else {
if ($num->{IPSTART} ne "") {
$ip = Net::IP->new($num->{IPSTART}.' - '.$num->{IPEND});
do {
if ($threads_run == 0) {
$iplist->{$countnb} = &share({});
}
$iplist->{$countnb}->{IP} = $ip->ip();
$iplist->{$countnb}->{ENTITY} = $num->{ENTITY};
$iplist2->{$countnb} = $countnb;
$countnb++;
$nbip++;
if ($nbip eq $limitip) {
if ($ip->ip() ne $num->{IPEND}) {
++$ip;
$num->{IPSTART} = $ip->ip();
$loop_action = 1;
goto CONTINUE;
}
$iplist->{$countnb}->{IP} = $ip->ip();
$iplist->{$countnb}->{ENTITY} = $num->{ENTITY};
$iplist2->{$countnb} = $countnb;
$countnb++;
$nbip++;
if ($nbip eq $limitip) {
if ($ip->ip() ne $num->{IPEND}) {
++$ip;
$num->{IPSTART} = $ip->ip();
$loop_action = 1;
goto CONTINUE;
}
} while (++$ip);
undef $ip;
$num->{IPSTART} = q{}; # Empty string
}
}
} while (++$ip);
undef $ip;
$num->{IPSTART} = q{}; # Empty string
}
}
}
Expand Down

0 comments on commit 135da79

Please sign in to comment.