fix defect #4326 [fvt]2.9:load config file failed if more than one mac during vm install
This commit is contained in:
		@@ -473,7 +473,7 @@ sub windows_net_cfg {
 | 
			
		||||
    unless ($mactab) { die "mac table should always exist prior to template processing when doing autoula"; }
 | 
			
		||||
    my $ent = $mactab->getNodeAttribs($node,['mac'],prefetchcache=>1);
 | 
			
		||||
    unless ($ent and $ent->{mac}) { die "missing mac data for $node"; }
 | 
			
		||||
    my $suffix = $ent->{mac};
 | 
			
		||||
    my $suffix = xCAT::Utils->parseMacTabEntry($ent->{mac},$node);
 | 
			
		||||
    my $mac = $suffix;
 | 
			
		||||
    $suffix = lc($suffix);
 | 
			
		||||
    $mac =~ s/:/-/g;
 | 
			
		||||
@@ -665,7 +665,7 @@ sub esxipv6setup {
 | 
			
		||||
	my $hoststab;
 | 
			
		||||
      my $mactab = xCAT::Table->new('mac',-create=>0);
 | 
			
		||||
      my $ent = $mactab->getNodeAttribs($node,['mac'],prefetchcache=>1);
 | 
			
		||||
      my $suffix = $ent->{mac};
 | 
			
		||||
      my $suffix = xCAT::Utils->parseMacTabEntry($ent->{mac},$node);
 | 
			
		||||
      $suffix = lc($suffix);
 | 
			
		||||
      unless ($mactab) { die "mac table should always exist prior to template processing when doing autoula"; }
 | 
			
		||||
 #in autoula, because ESXi weasel doesn't seemingly grok IPv6 at all, we'll have to do it in %pre
 | 
			
		||||
@@ -693,7 +693,7 @@ sub kickstartnetwork {
 | 
			
		||||
      unless ($mactab) { $tmplerr ="mac table should always exist prior to template processing when doing autoula"; return;}
 | 
			
		||||
      my $ent = $mactab->getNodeAttribs($node,['mac'],prefetchcache=>1);
 | 
			
		||||
      unless ($ent and $ent->{mac}) { $tmplerr ="missing mac data for $node"; return;}
 | 
			
		||||
      my $suffix = $ent->{mac};
 | 
			
		||||
      my $suffix = xCAT::Utils->parseMacTabEntry($ent->{mac},$node);
 | 
			
		||||
      $suffix = lc($suffix);
 | 
			
		||||
	if ($::XCATSITEVALS{managedaddressmode} eq "autoula") {
 | 
			
		||||
		unless ($hoststab) { $hoststab = xCAT::Table->new('hosts',-create=>1); }
 | 
			
		||||
@@ -746,7 +746,7 @@ sub yast2network {
 | 
			
		||||
      unless ($mactab) { die "mac table should always exist prior to template processing when doing autoula"; }
 | 
			
		||||
      my $ent = $mactab->getNodeAttribs($node,['mac'],prefetchcache=>1);
 | 
			
		||||
      unless ($ent and $ent->{mac}) { die "missing mac data for $node"; }
 | 
			
		||||
      my $suffix = $ent->{mac};
 | 
			
		||||
      my $suffix = xCAT::Utils->parseMacTabEntry($ent->{mac},$node);
 | 
			
		||||
      $suffix = lc($suffix);
 | 
			
		||||
	if ($::XCATSITEVALS{managedaddressmode} eq "autoula") {
 | 
			
		||||
           #TODO
 | 
			
		||||
 
 | 
			
		||||
@@ -1434,7 +1434,7 @@ sub mkinstall
 | 
			
		||||
                {
 | 
			
		||||
                    my $mactab = xCAT::Table->new("mac");
 | 
			
		||||
                    my $macref = $mactab->getNodeAttribs($node, ['mac']);
 | 
			
		||||
                    $ksdev = $macref->{mac};
 | 
			
		||||
                    $ksdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node);
 | 
			
		||||
                }
 | 
			
		||||
                else
 | 
			
		||||
                {
 | 
			
		||||
@@ -1447,7 +1447,7 @@ sub mkinstall
 | 
			
		||||
                {
 | 
			
		||||
                    my $mactab = xCAT::Table->new("mac");
 | 
			
		||||
                    my $macref = $mactab->getNodeAttribs($node, ['mac']);
 | 
			
		||||
                    $ksdev = $macref->{mac};
 | 
			
		||||
                    $ksdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node);
 | 
			
		||||
                }
 | 
			
		||||
                else
 | 
			
		||||
                {
 | 
			
		||||
@@ -1896,7 +1896,7 @@ sub mksysclone
 | 
			
		||||
                {
 | 
			
		||||
                    my $mactab = xCAT::Table->new("mac");
 | 
			
		||||
                    my $macref = $mactab->getNodeAttribs($node, ['mac']);
 | 
			
		||||
                    $ksdev = $macref->{mac};
 | 
			
		||||
                    $ksdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node);
 | 
			
		||||
                }
 | 
			
		||||
                else
 | 
			
		||||
                {
 | 
			
		||||
@@ -1909,7 +1909,7 @@ sub mksysclone
 | 
			
		||||
                {
 | 
			
		||||
                    my $mactab = xCAT::Table->new("mac");
 | 
			
		||||
                    my $macref = $mactab->getNodeAttribs($node, ['mac']);
 | 
			
		||||
                    $ksdev = $macref->{mac};
 | 
			
		||||
                    $ksdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node);
 | 
			
		||||
                }
 | 
			
		||||
                else
 | 
			
		||||
                {
 | 
			
		||||
@@ -1963,7 +1963,7 @@ sub mksysclone
 | 
			
		||||
            if ($archref->{arch} eq "ppc64"){
 | 
			
		||||
                my $mactab = xCAT::Table->new('mac');
 | 
			
		||||
                my $macref = $mactab->getNodeAttribs($node, ['mac']);
 | 
			
		||||
                my $formatmac = $macref->{mac};
 | 
			
		||||
                my $formatmac = xCAT::Utils->parseMacTabEntry($macref->{mac},$node);
 | 
			
		||||
                $formatmac =~ s/:/-/g;
 | 
			
		||||
                $formatmac = "01-".$formatmac;
 | 
			
		||||
                $kcmdline .= " BOOTIF=$formatmac ";
 | 
			
		||||
 
 | 
			
		||||
@@ -812,7 +812,7 @@ sub mkinstall
 | 
			
		||||
                if ($ent->{installnic} eq "mac"){
 | 
			
		||||
                    my $mactab = xCAT::Table->new("mac");
 | 
			
		||||
                    my $macref = $mactab->getNodeAttribs($node, ['mac']);
 | 
			
		||||
                    $ksdev = $macref->{mac};
 | 
			
		||||
                    $ksdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node);
 | 
			
		||||
                }
 | 
			
		||||
                else{
 | 
			
		||||
                    $ksdev = $ent->{installnic};
 | 
			
		||||
@@ -822,7 +822,7 @@ sub mkinstall
 | 
			
		||||
                if ($ent->{primarynic} eq "mac"){
 | 
			
		||||
                    my $mactab = xCAT::Table->new("mac");
 | 
			
		||||
                    my $macref = $mactab->getNodeAttribs($node, ['mac']);
 | 
			
		||||
                    $ksdev = $macref->{mac};
 | 
			
		||||
                    $ksdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node);
 | 
			
		||||
                }
 | 
			
		||||
                else{
 | 
			
		||||
                    $ksdev = $ent->{primarynic};
 | 
			
		||||
 
 | 
			
		||||
@@ -579,7 +579,7 @@ sub mkinstall {
 | 
			
		||||
                        if ($ent->{installnic} eq "mac") {
 | 
			
		||||
                            my $mactab = xCAT::Table->new("mac");
 | 
			
		||||
                            my $macref = $mactab->getNodeAttribs($node, ['mac']);
 | 
			
		||||
                            $ksdev = $macref->{mac};
 | 
			
		||||
                            $ksdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node);
 | 
			
		||||
                        }  else {
 | 
			
		||||
                            $ksdev = $ent->{installnic};
 | 
			
		||||
                        }
 | 
			
		||||
@@ -587,7 +587,7 @@ sub mkinstall {
 | 
			
		||||
                        if ($ent->{primarynic} eq "mac") {
 | 
			
		||||
                            my $mactab = xCAT::Table->new("mac");
 | 
			
		||||
                            my $macref = $mactab->getNodeAttribs($node, ['mac']);
 | 
			
		||||
                            $ksdev = $macref->{mac};
 | 
			
		||||
                            $ksdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node);
 | 
			
		||||
                        } else {
 | 
			
		||||
                            $ksdev = $ent->{primarynic};
 | 
			
		||||
                        }
 | 
			
		||||
 
 | 
			
		||||
@@ -582,7 +582,7 @@ sub mknetboot
 | 
			
		||||
 | 
			
		||||
        # add the kernel-booting parameter: netdev=<eth0>, or BOOTIF=<mac>
 | 
			
		||||
        my $netdev = "";
 | 
			
		||||
        my $mac = $machash->{$node}->[0]->{mac};
 | 
			
		||||
        my $mac = xCAT::Utils->parseMacTabEntry($machash->{$node}->[0]->{mac},$node);
 | 
			
		||||
 | 
			
		||||
        if ($reshash->{$node}->[0] and $reshash->{$node}->[0]->{installnic} and ($reshash->{$node}->[0]->{installnic} ne "mac")) {
 | 
			
		||||
                $kcmdline .= "netdev=" . $reshash->{$node}->[0]->{installnic} . " ";
 | 
			
		||||
@@ -1115,7 +1115,7 @@ sub mkinstall
 | 
			
		||||
                {
 | 
			
		||||
                    my $mactab = xCAT::Table->new("mac");
 | 
			
		||||
                    my $macref = $mactab->getNodeAttribs($node, ['mac']);
 | 
			
		||||
                    $netdev = $macref->{mac};
 | 
			
		||||
                    $netdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node);
 | 
			
		||||
                 }
 | 
			
		||||
                else
 | 
			
		||||
                {
 | 
			
		||||
@@ -1128,7 +1128,7 @@ sub mkinstall
 | 
			
		||||
                {
 | 
			
		||||
                    my $mactab = xCAT::Table->new("mac");
 | 
			
		||||
                    my $macref = $mactab->getNodeAttribs($node, ['mac']);
 | 
			
		||||
                    $netdev = $macref->{mac};
 | 
			
		||||
                    $netdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node);
 | 
			
		||||
                }
 | 
			
		||||
                else
 | 
			
		||||
                {
 | 
			
		||||
@@ -1463,7 +1463,7 @@ sub mksysclone
 | 
			
		||||
            {
 | 
			
		||||
                my $mactab = xCAT::Table->new("mac");
 | 
			
		||||
                my $macref = $mactab->getNodeAttribs($node, ['mac']);
 | 
			
		||||
                $ksdev = $macref->{mac};
 | 
			
		||||
                $ksdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            unless ( $ksdev eq "bootif" ) {
 | 
			
		||||
@@ -1498,7 +1498,7 @@ sub mksysclone
 | 
			
		||||
            if ($archref->{arch} eq "ppc64"){
 | 
			
		||||
                my $mactab = xCAT::Table->new('mac');
 | 
			
		||||
                my $macref = $mactab->getNodeAttribs($node, ['mac']);
 | 
			
		||||
                my $formatmac = $macref->{mac};
 | 
			
		||||
                my $formatmac = xCAT::Utils->parseMacTabEntry($macref->{mac},$node);
 | 
			
		||||
                $formatmac =~ s/:/-/g;
 | 
			
		||||
                $formatmac = "01-".$formatmac;
 | 
			
		||||
                $kcmdline .= " BOOTIF=$formatmac ";
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user