Changeset 301


Ignore:
Timestamp:
Jul 18, 2018, 2:12:55 PM (6 years ago)
Author:
g7moreau
Message:
  • Small work on disable_float
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ddt/ddt

    r300 r301  
    11941194      my @domainsetdb = @{$computer_db->{$domainset_current}};
    11951195
    1196       $cpt_mac=0;
    1197       for my $value (@domainsetdb) {
    1198          for my $id (keys %{$value}) {
    1199             if ($id eq $mac) {
    1200                if ($value->{$id}->{'ip'} eq $pool) {
     1196      #$cpt_mac=0;
     1197      for my $computer (@domainsetdb) {
     1198         for my $mac_current (keys %{$computer}) {
     1199            if ($mac_current eq $mac) {
     1200               if ($computer->{$mac}{'ip'} eq $pool) {
    12011201                  #splice(@{$computer_db->($domainset_current)} , $cpt_mac => 1);
    12021202                  my $timestamp = time;
    1203                   $computer_db->{$domainset_current}[$cpt_mac]->{$id}->{'modify_time'} = $timestamp;
    1204                   $computer_db->{$domainset_current}[$cpt_mac]->{$id}->{'enabled'} = 'no';
    1205                   print  $computer_db->{$domainset_current}[$cpt_mac]->{$id}->{'enabled'}."\n";
     1203                  $computer->{$mac}{'modify_time'} = $timestamp;
     1204                  $computer->{$mac}{'enabled'}     = 'no';
    12061205                  ipamdb_save("$COMPUTER_YAML", $computer_db);
    1207                   print "Désactivation de la machine $mac du pool $pool [OK]\n";
     1206                  print "Disabling machine $mac from pool $pool [OK]\n";
     1207                  print "+-> Status:" . $computer->{$mac}{'enabled'} . "\n";
    12081208                  exit;
    12091209                  }
    12101210               else {
    1211                   print "Désactivation de la machine $mac [FAILED]\n";
    1212                   print "La machine $mac n'appartient pas au pool $pool.\n";
     1211                  print "Computer disable $mac [FAILED]\n";
     1212                  print "+-> The computer $mac does not belong to the $pool pool.\n";
    12131213                  exit;
    12141214                  }
    12151215               }
    1216             $cpt_mac++;
     1216            #$cpt_mac++;
    12171217            }
    12181218         }
Note: See TracChangeset for help on using the changeset viewer.