Changeset 305


Ignore:
Timestamp:
Jul 18, 2018, 7:19:20 PM (6 years ago)
Author:
g7moreau
Message:
  • Change some code order
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ddt/ddt

    r304 r305  
    11581158         next LOOP_ON_COMPUTER if $attribute->{'hostname'} ne $hostname;
    11591159
    1160          if ($attribute->{'address_type'} ne 'pool-dhcp') {
    1161 
    1162             if ($attribute->{'enabled'} eq 'no') {
    1163                print "Info: Host $hostname from domain set $domainset is already disable [OK]" .
    1164                   " ... Status: $attribute->{'enabled'}\n";
    1165                exit;
    1166                }
    1167 
    1168             my $timestamp = time;
    1169             $attribute->{'modify_time'} = $timestamp;
    1170             $attribute->{'enabled'}     = 'no';
    1171             ipamdb_save("$COMPUTER_YAML", $computer_db);
    1172             print "Info: Disabling host $hostname from domain set $domainset [OK]" .
     1160         if ($attribute->{'address_type'} eq 'pool-dhcp') {
     1161            die "Error: Host $hostname from domain set $domainset belongs to a a pool [FAILED]" .
     1162               " ... use 'disable-float' command instead";
     1163            }
     1164
     1165         if ($attribute->{'enabled'} eq 'no') {
     1166            print "Info: Host $hostname from domain set $domainset is already disable [OK]" .
    11731167               " ... Status: $attribute->{'enabled'}\n";
    11741168            exit;
    11751169            }
    11761170
    1177          if ($attribute->{'address_type'} eq 'pool-dhcp') {
    1178             die "Error: Host $hostname from domain set $domainset inside a pool [FAILED]" .
    1179             }
     1171         my $timestamp = time;
     1172         $attribute->{'modify_time'} = $timestamp;
     1173         $attribute->{'enabled'}     = 'no';
     1174         ipamdb_save("$COMPUTER_YAML", $computer_db);
     1175         print "Info: Disabling host $hostname from domain set $domainset [OK]" .
     1176            " ... Status: $attribute->{'enabled'}\n";
     1177         exit;
    11801178         }
    11811179      }
Note: See TracChangeset for help on using the changeset viewer.