Fix problem where missing prodkey table would induce failure

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@15067 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2013-02-05 18:52:41 +00:00
parent f281378f89
commit 2bd19274ac

View File

@ -372,7 +372,10 @@ sub windows_join_data {
sub get_win_prodkey {
my $osvariant = shift;
my $keytab = xCAT::Table->new("prodkey",-create=>0);
my $keyent = $keytab->getAttribs({product=>$osvariant},"key");
my $keyent;
if ($keytab) {
$keyent = $keytab->getAttribs({product=>$osvariant},"key");
}
if ($keyent) {
return "<ProductKey><WillShowUI>OnError</WillShowUI><Key>".$keyent->{key}."</Key></ProductKey>";
}