Changeset 3788 in /cluster/svnroot


Ignore:
Timestamp:
Aug 30, 2012 10:20:37 PM (8 years ago)
Author:
skylar
Message:

moving dhcp stance detection into Bccd.pm (#729)

Location:
bccd-ng/branches/skylar/bccd-3.1.1/trees
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • bccd-ng/branches/skylar/bccd-3.1.1/trees/bin/bccd-nic-setup

    r3778 r3788  
    4141       
    4242        foreach my $nic ($Bccd->get_eth_nics()) {
    43                 # Response is a hash ref of ipaddr and subnet mask
    44                 $response = $Bccd->run_nic_dhcp($nic,'/etc/dhcp/dhclient.conf-bccd');
    45                
    46                 if(defined($response)) {
    47                         $nic_conf->{$nic} = $response;
    48                         $nic_conf->{$nic}->{'dhcp_source'} = 'BCCD';
    49                 }
    50                 else {
    51                         $response = $Bccd->run_nic_dhcp($nic,'/etc/dhcp/dhclient.conf-any');
    52                         if(defined($response)) {
    53                                 $nic_conf->{$nic} = $response;
    54                                 $nic_conf->{$nic}->{'dhcp_source'} = 'OTHER';
    55                         }
    56                 }
    57                 # Fall through for interfaces with no DHCP
    58                 if(!defined($response)) {
    59                         $nic_conf->{$nic}{'dhcp'} = 0;
    60                 }
     43        $Bccd->set_dhcp_stance($nic);
    6144        }
    6245       
    63         $nic_conf = $Bccd->config_nic_dialog($d,$nic_conf);
     46        $Bccd->config_nic_dialog($d);
    6447       
    65         $nic_conf = $Bccd->config_interfaces($nic_conf);
    66         $nic_conf = $Bccd->config_dhcp($nic_conf);
     48        $Bccd->config_interfaces();
     49        $Bccd->config_dhcp($nic_conf);
    6750
    6851        ($out,$rc) = $Bccd->run_test("system","","Starting networking","/etc/init.d/networking start"); # No invoke-rc.d because utmp has not been updated
  • bccd-ng/branches/skylar/bccd-3.1.1/trees/usr/local/lib/site_perl/Bccd.pm

    r3787 r3788  
    25242524}
    25252525
     2526# Detect other BCCD systems and set DHCP accordingly
     2527sub set_dhcp_stance {
     2528    my($self,$nic) = @_;
     2529    my($response,$sub);
     2530    $sub = 'set_dhcp_stance';
     2531
     2532    # Response is a hash ref of ipaddr and subnet mask
     2533    $response
     2534        = $self->run_nic_dhcp($nic,'/etc/dhcp/dhclient.conf-bccd');
     2535    if(defined($response)) {
     2536        $self->{nic_conf}->{$nic} = $response;
     2537        $self->{nic_conf}->{$nic}->{'dhcp_source'} = 'BCCD';
     2538    }
     2539    else {
     2540        $response
     2541            = $self->run_nic_dhcp($nic,'/etc/dhcp/dhclient.conf-any');
     2542        if(defined($response)) {
     2543            $nic_conf->{$nic} = $response;
     2544            $nic_conf->{$nic}->{'dhcp_source'} = 'OTHER';
     2545        }
     2546    }
     2547    # Fall through for interfaces with no DHCP
     2548    if(!defined($response)) {
     2549        $nic_conf->{$nic}{'dhcp'} = 0;
     2550    }
     2551
     2552    return 1;
     2553}
     2554
    25262555sub run_nic_dhcp {
    25272556    my($self,$nic,$cfg) = @_;
Note: See TracChangeset for help on using the changeset viewer.