Support per-node product keys, defaulting to 'os key' if nothing specified

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@15818 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2013-04-03 20:34:26 +00:00
parent 250336787e
commit af9428ed10

View File

@ -471,7 +471,18 @@ sub get_win_prodkey {
my $keytab = xCAT::Table->new("prodkey",-create=>0);
my $keyent;
if ($keytab) {
$keyent = $keytab->getAttribs({product=>$osvariant},"key");
my @keyents = $keytab->getNodeAttribs($node,[qw/product key/]);
foreach my $tkey (@keyents) {
if ($tkey->{product} eq $osvariant) {
$keyent = $tkey;
last;
} elsif (not $tkey->{product}) {
$keyent = $tkey;
}
}
unless ($keyent) {
$keyent = $keytab->getAttribs({product=>$osvariant},"key");
}
}
if ($keyent) {
return "<ProductKey><WillShowUI>OnError</WillShowUI><Key>".$keyent->{key}."</Key></ProductKey>";