Changeset 365 for trunk


Ignore:
Timestamp:
Sep 17, 2018, 11:24:54 AM (6 years ago)
Author:
g7moreau
Message:
  • Error in $mac variable (change_type)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ddt/ddt

    r364 r365  
    11291129   control_exist_sector($computer_db, $sector) or exit;
    11301130
    1131    $mac = get_mac_from_hostname($computer_db, $sector, $hostname, $mac);
    1132    control_syntax_mac_address($mac) or exit;
    1133 
    11341131   LOOP_ON_COMPUTER:
    11351132   for my $computer (@{$computer_db->{$sector}}) {
    11361133      my ($mac_address, $attribute) = %{$computer};
    11371134
    1138       next LOOP_ON_COMPUTER if $mac_address ne $mac;
     1135      next LOOP_ON_COMPUTER if $attribute->{'hostname'} ne $hostname;
     1136
     1137      die "Warning: host $hostname already of type $type\n" if $attribute->{'address_type'} eq $type;
    11391138
    11401139      $attribute->{'address_type'}  = $type;
     
    11441143      exit;
    11451144      }
    1146    print "Error: change host $hostname type [FAILED]\n";
     1145   die "Error: change host $hostname type [FAILED]\n";
    11471146   }
    11481147
Note: See TracChangeset for help on using the changeset viewer.