- Timestamp:
- Jul 18, 2018, 11:51:42 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ddt/ddt
r294 r295 2268 2268 next if $domainset_current eq 'version'; 2269 2269 2270 print "\n# *** List of computers without IPin the domain set: $domainset_current ***\n";2270 print "\n# *** List of pool computers in the domain set: $domainset_current ***\n"; 2271 2271 printf "%-30s %-20s %17s %5s %7s %-10s %s\n", 2272 2272 'Hostname', … … 2282 2282 for my $computer (@domainsetdb) { 2283 2283 my ($mac_address, $attribute) = %{$computer}; 2284 2285 if ($attribute->{'ip'} =~ m/$DDT::RE::IPv4_ADDRESS/xms) { 2286 if ( not exists $ipdb{ $attribute->{'ip'} } ) { 2287 $ipdb{ $attribute->{'ip'} } = { 2284 my $ip = $attribute->{'ip'}; 2285 2286 if ($ip =~ m/$DDT::RE::IPv4_ADDRESS/xms) { 2287 if ( not exists $ipdb{$ip} ) { 2288 $ipdb{$ip} = { 2288 2289 'mac_address' => $mac_address, 2289 2290 %{$attribute}, 2290 'domain '=> $domainset_current,2291 'domainset' => $domainset_current, 2291 2292 }; 2292 2293 next LOOP_ON_COMPUTER; 2293 2294 } 2294 2295 else { 2295 print {*STDERR} "# Warning: $ attribute->{'ip'}already exists in the database !\n";2296 print {*STDERR} "# Warning: $ip already exists in the database !\n"; 2296 2297 } 2297 2298 } … … 2305 2306 $comment =~ s/^\d\d\d\d-\d\d-\d\d\s//; 2306 2307 2307 my $ip = $attribute->{'ip'};2308 2309 2308 my $enable = $attribute->{'enabled'}; 2310 2309 if (exists $attribute->{'pxe_config'}) { 2311 2310 $enable .= '/' . $attribute->{'pxe_config'}; 2312 2311 } 2313 if (exists $ ipdb{$ip}->{'tag'}) {2314 $enable .= ':' . $ ipdb{$ip}->{'tag'};2312 if (exists $attribute->{'tag'}) { 2313 $enable .= ':' . $attribute->{'tag'}; 2315 2314 } 2316 2315 … … 2346 2345 2347 2346 printf "%-30s %-20s %17s %9s %3s %10s %s\n", 2348 $ipdb{$ip}->{'hostname'} . '.' . $ipdb{$ip}->{'domain '},2347 $ipdb{$ip}->{'hostname'} . '.' . $ipdb{$ip}->{'domainset'}, 2349 2348 $ip, 2350 2349 normalize_mac_address($ipdb{$ip}->{'mac_address'}),
Note: See TracChangeset
for help on using the changeset viewer.