Changeset 361 for trunk/ddt/ddt


Ignore:
Timestamp:
Sep 14, 2018, 10:03:14 PM (6 years ago)
Author:
g7moreau
Message:
  • Change ip-range in db to ip_range
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ddt/ddt

    r360 r361  
    16681668
    16691669   my $timestamp = time;
    1670    $computer_db->{'dset'}{$sector}{'ip-range'} ||= [];
     1670   $computer_db->{'dset'}{$sector}{'ip_range'} ||= [];
    16711671   LOOP_ON_CIDR:
    1672    for my $cidr_current (@{$computer_db->{'dset'}{$sector}{'ip-range'}}) {
     1672   for my $cidr_current (@{$computer_db->{'dset'}{$sector}{'ip_range'}}) {
    16731673      next LOOP_ON_CIDR if $cidr_current ne $ip_range;
    16741674     
     
    16771677
    16781678   my $timestamp = time;
    1679    push @{$computer_db->{'dset'}{$sector}{'ip-range'}}, $ip_range;
     1679   push @{$computer_db->{'dset'}{$sector}{'ip_range'}}, $ip_range;
    16801680   $computer_db->{'dset'}{$sector}{'modify_time'} = $timestamp;
    16811681   ipamdb_save("$COMPUTER_YAML", $computer_db);
     
    22512251
    22522252      my $ip_range;
    2253       $ip_range = join ',', @{$computer_db->{'dset'}{$sector_current}{'ip-range'}} if exists $computer_db->{'dset'}{$sector_current}{'ip-range'};
     2253      $ip_range = join ',', @{$computer_db->{'dset'}{$sector_current}{'ip_range'}} if exists $computer_db->{'dset'}{$sector_current}{'ip_range'};
    22542254
    22552255      my $category;
     
    27692769            LOOP_ON_IP:
    27702770            for my $ip (NetAddr::IP->new($ip_range)->hostenum()) {
     2771               $ip =~ s{/32$}{};
    27712772               print "$ip\n";
    27722773               
     
    27862787               # Verify direct return same host
    27872788               LOOP_ON_COMPUTER:
    2788                for my $computer (@{$computer_db->{$sector_current}) {
     2789               for my $computer (@{$computer_db->{$sector_current}}) {
    27892790                  my ($mac_address, $attribute) = %{$computer};
    27902791
     
    27982799
    27992800               # Declare in DNS but not in DDT
    2800                print "Error: DNS host $dns_hostname with IP $ip not declare in DDT database\n" if $dns_hostname ne '';
     2801               print "Error: DNS host $dns_hostname in sector $sector_current with IP $ip not declare in DDT database\n" if $dns_hostname ne '';
    28012802               # Normally never arrive here
    28022803
Note: See TracChangeset for help on using the changeset viewer.