Changeset 3074 in /cluster/svnroot


Ignore:
Timestamp:
Mar 21, 2011 10:08:42 AM (10 years ago)
Author:
leemasa
Message:

Removed some debugging output and added documentation (#524)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bccd-ng/branches/sam-test_fw/trees/usr/local/lib/site_perl/5.10.0/Bccd.pm

    r3072 r3074  
    21902190
    21912191sub config_nic_dialog {
    2192         print "Starting config_nic_dialog";
    21932192    my($self,$d,$nic_conf) = @_;
    21942193    my($temp,$bccd_nic,$gotpxe,$dhcp_source,$sub);
     
    22232222                        open (TEST,'</bccd_boot_flags') or croak "$!";
    22242223                my      @command = grep (/BCCD_NIC/, <TEST>);
    2225                 print "|" . $command[0] . "|\n";
    22262224                        if ($command[0] =~ m/export BCCD_NIC=(.*)$/){
    22272225                                $bccd_nic = $1;
    22282226                        }
    2229                         #system ("/bccd_boot_flags") or croak "could not run /bccd_boot_flags: $!";
    2230                         #$bccd_nic = $ENV{'BCCD_NIC'};
    2231                         print "test\ntest\ntest\ntest\nBCCD NIC:|$bccd_nic|\n";
    2232                         sleep 1;
     2227                        print STDERR "$bccd_nic selected for BCCD network\n"
    22332228                }
    22342229        if(defined($bccd_nic) && !$self->check_bccd_net($nic_conf)) {
     
    23122307        }
    23132308    }
    2314        
    2315         print "ending config_nic_dialog:";
    2316         foreach my $key ( keys %{$nic_conf}){
    2317         print "$key->" . $nic_conf->{$key} ;
    2318         }
    2319    
    23202309    return $nic_conf;
    23212310}
     
    24512440                        $open_hex = $1.$2;
    24522441                } else {
    2453                         die "Error in detecting last three hexes in MAC";
     2442                        die "Error in detecting last three hexes in MAC $!";
    24542443                }
    24552444
     
    24852474
    24862475        if ($boot_flags){
    2487                 open(BOOTFLAGS, ">/bccd_boot_flags") or die "Could not open file:$!";
    2488                         print BOOTFLAGS $boot_flags;
     2476                open(BOOTFLAGS, ">/bccd_boot_flags")
     2477                        or die "Could not open /bccd_boot_flags:$!";
     2478                print BOOTFLAGS $boot_flags;
    24892479                close(BOOTFLAGS);
    24902480                chmod 0755, '/bccd_boot_flags';
     
    26302620Takes a source and destination path and rsync's the source to the destination.
    26312621
     2622=head2 MISCELLANEOUS SUBROUTINES
     2623
     2624These do not take any standardized arguments
     2625
     2626=head3 get_boot_flags_from_NIC(%)
     2627
     2628Takes data from the NIC's MAC address and populates /bccd_boot_flags
     2629according to key-position hash.
     2630
     2631Splits the last three hexes of the bccd network's custom NIC
     2632into a 12 digit binary string. Takes a hash of keys and
     2633positions in that binary string. Key translates directly into
     2634the name of the environment variable into which the information
     2635is stored, and the position is a comma-separated-value list
     2636with an index (starting at 0) and optionally a bit length (default 1).
     2637so ('BUILD_CONTROL' => 1) takes the second bit in the last
     2638three digits of the MAC and writes "export BUILD_CONTROL=<value>" to
     2639/bccd_boot_flags
     2640
     2641The first entry in /bccd_boot_flags is always "export BCCD_NIC=<BCCD NIC>"
     2642
     2643For a list of the official automated test bootflags
     2644and their corresponding locations, check the BCCD Wiki
     2645
    26322646=cut
Note: See TracChangeset for help on using the changeset viewer.