merge profile consistent check fix from 2.8 branch

This commit is contained in:
Lei Ai 2014-07-10 11:39:09 +08:00
parent a3cc1f8c3d
commit 9b7842df35

View File

@ -719,28 +719,6 @@ sub get_nodes_profiles
return \%profile_dict;
}
#-------------------------------------------------------------------------------
=head3 get_imageprofile_prov_osvers
Description : Get A node's provisioning os version and profile from its imageprofile attribute.
Arguments : $imgprofilename - imageprofile name
Returns : node's osversion and profile
=cut
#-------------------------------------------------------------------------------
sub get_imageprofile_prov_osvers
{
my $class = shift;
my $imgprofilename = shift;
my $osimgtab = xCAT::Table->new('osimage');
my $osimgentry = ($osimgtab->getAllAttribsWhere("imagename = '$imgprofilename'", 'ALL' ))[0];
my $osversion = $osimgentry->{'osvers'};
my $profile = $osimgentry->{'profile'};
return ($osversion, $profile);
}
#-------------------------------------------------------------------------------
=head3 get_imageprofile_prov_method
@ -770,6 +748,27 @@ sub get_imageprofile_prov_method
#-------------------------------------------------------------------------------
=head3 get_imageprofile_prov_osvers
Description : Get A node's provisioning os version and profile from its imageprofile attribute.
Arguments : $imgprofilename - imageprofile name
Returns : node's osversion and profile
=cut
#-------------------------------------------------------------------------------
sub get_imageprofile_prov_osvers
{
my $class = shift;
my $imgprofilename = shift;
my $osimgtab = xCAT::Table->new('osimage');
my $osimgentry = ($osimgtab->getAllAttribsWhere("imagename = '$imgprofilename'", 'ALL' ))[0];
my $osversion = $osimgentry->{'osvers'};
my $profile = $osimgentry->{'profile'};
return ($osversion, $profile);
}
#-------------------------------------------------------------------------------
=head3 check_profile_consistent
Description : Check if three profile consistent
Arguments : $imageprofile - image profile name
@ -861,6 +860,11 @@ sub check_profile_consistent{
return 0, "$nictype networkprofile must use with hardwareprofile.";
}
}
if ($mgt eq 'vm')
{
return 1, "";
}
# For nodetype is lpar node, not need to check the nictype as it is not required for lpar node
if (not $nictype and $mgt and $nodetype ne 'lpar' ) {