Changeset 549 for branches/stable/cgi-bin/IPDB.pm
- Timestamp:
- 11/09/12 11:57:22 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/cgi-bin/IPDB.pm
r509 r549 375 375 } else { # end IP-from-pool allocation 376 376 377 my $errcode = 'OK'; 377 378 if ($cidr == $alloc_from) { 378 379 # Easiest case- insert in one table, delete in the other, and go home. More or less. … … 415 416 my ($code,$rmsg) = initPool($dbh,$cidr,$type,$city,"all"); 416 417 die $rmsg if $code eq 'FAIL'; 418 $msg = $rmsg; 419 $errcode = $code; 417 420 } elsif ($type =~ /^.d$/) { 418 421 $msg = "Could not initialize IPs in new $disp_alloctypes{$type} $cidr"; 419 422 my ($code,$rmsg) = initPool($dbh,$cidr,$type,$city,"normal"); 420 423 die $rmsg if $code eq 'FAIL'; 424 $msg = $rmsg; 425 $errcode = $code; 421 426 } 422 427 … … 436 441 return ('FAIL',$msg); 437 442 } else { 438 return ( 'OK',"OK");443 return ($errcode,($type =~ /^.[pd]$/ ? $msg : "OK")); 439 444 } 440 445 … … 546 551 return ('FAIL',$msg); 547 552 } else { 548 return ( 'OK',"OK");553 return ($errcode,($type =~ /^.[pd]$/ ? $msg : "OK")); 549 554 } 550 555 … … 566 571 my ($dbh,undef,$type,$city,$class) = @_; 567 572 my $pool = new NetAddr::IP $_[1]; 573 574 return ('WARN','Refusing to melt server with IPv6 IP pool') if $pool->bits == 128; 568 575 569 576 ##fixme Need to just replace 2nd char of type with i rather than capturing 1st char of type
Note:
See TracChangeset
for help on using the changeset viewer.