From ff2affd5511348488bc83d782b70f870928c63b8 Mon Sep 17 00:00:00 2001 From: ligc Date: Wed, 23 Jan 2013 07:52:19 +0000 Subject: [PATCH] provide a way to disable the warning message when run nodeset install/netboot/statelite git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14957 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/anaconda.pm | 42 +++++++++++++++--------- xCAT-server/lib/xcat/plugins/sles.pm | 38 +++++++++++++-------- 2 files changed, 50 insertions(+), 30 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 0896f5bbb..fb9679673 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -228,14 +228,19 @@ sub mknetboot if ($ent && $ent->{provmethod} && (($ent->{provmethod} eq 'install') || ($ent->{provmethod} eq 'netboot') || ($ent->{provmethod} eq 'statelite'))) { - $callback->( - { - warning => ["The options \"install\", \"netboot\", and \"statelite\" have been deprecated. They should continue to work in this release, but have not been tested as carefully, and some new functions are not available with these options. For full function and support, use \"nodeset osimage=\" instead."], - } - ); - # Do not print this warning message multiple times - last; - } + my @ents = xCAT::TableUtils->get_site_attribute("disablenodesetwarning"); + my $site_ent = $ents[0]; + if (!defined($site_ent) || ($site_ent =~ /no/i) || ($site_ent =~ /0/)) + { + $callback->( + { + warning => ["The options \"install\", \"netboot\", and \"statelite\" have been deprecated. They should continue to work in this release, but have not been tested as carefully, and some new functions are not available with these options. For full function and support, use \"nodeset osimage=\" instead."], + } + ); + # Do not print this warning message multiple times + last; + } + } } foreach my $node (@nodes) { @@ -948,14 +953,19 @@ sub mkinstall if ($ent && $ent->{provmethod} && (($ent->{provmethod} eq 'install') || ($ent->{provmethod} eq 'netboot') || ($ent->{provmethod} eq 'statelite'))) { - $callback->( - { - warning => ["The options \"install\", \"netboot\", and \"statelite\" have been deprecated. They should continue to work in this release, but have not been tested as carefully, and some new functions are not available with these options. For full function and support, use \"nodeset osimage=\" instead."], - } - ); - # Do not print this warning message multiple times - last; - } + my @ents = xCAT::TableUtils->get_site_attribute("disablenodesetwarning"); + my $site_ent = $ents[0]; + if (!defined($site_ent) || ($site_ent =~ /no/i) || ($site_ent =~ /0/)) + { + $callback->( + { + warning => ["The options \"install\", \"netboot\", and \"statelite\" have been deprecated. They should continue to work in this release, but have not been tested as carefully, and some new functions are not available with these options. For full function and support, use \"nodeset osimage=\" instead."], + } + ); + # Do not print this warning message multiple times + last; + } + } } foreach $node (@nodes) { diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index 0eadf8d4e..9552bacb0 100644 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -107,13 +107,18 @@ sub mknetboot if ($ent && $ent->{provmethod} && (($ent->{provmethod} eq 'install') || ($ent->{provmethod} eq 'netboot') || ($ent->{provmethod} eq 'statelite'))) { - $callback->( - { - warning => ["The options \"install\", \"netboot\", and \"statelite\" have been deprecated. They should continue to work in this release, but have not been tested as carefully, and some new functions are not available with these options. For full function and support, use \"nodeset osimage=\" instead."], - } - ); - # Do not print this warning message multiple times - last; + my @ents = xCAT::TableUtils->get_site_attribute("disablenodesetwarning"); + my $site_ent = $ents[0]; + if (!defined($site_ent) || ($site_ent =~ /no/i) || ($site_ent =~ /0/)) + { + $callback->( + { + warning => ["The options \"install\", \"netboot\", and \"statelite\" have been deprecated. They should continue to work in this release, but have not been tested as carefully, and some new functions are not available with these options. For full function and support, use \"nodeset osimage=\" instead."], + } + ); + # Do not print this warning message multiple times + last; + } } } foreach my $node (@nodes) @@ -717,13 +722,18 @@ sub mkinstall if ($ent && $ent->{provmethod} && (($ent->{provmethod} eq 'install') || ($ent->{provmethod} eq 'netboot') || ($ent->{provmethod} eq 'statelite'))) { - $callback->( - { - warning => ["The options \"install\", \"netboot\", and \"statelite\" have been deprecated. They should continue to work in this release, but have not been tested as carefully, and some new functions are not available with these options. For full function and support, use \"nodeset osimage=\" instead."], - } - ); - # Do not print this warning message multiple times - last; + my @ents = xCAT::TableUtils->get_site_attribute("disablenodesetwarning"); + my $site_ent = $ents[0]; + if (!defined($site_ent) || ($site_ent =~ /no/i) || ($site_ent =~ /0/)) + { + $callback->( + { + warning => ["The options \"install\", \"netboot\", and \"statelite\" have been deprecated. They should continue to work in this release, but have not been tested as carefully, and some new functions are not available with these options. For full function and support, use \"nodeset osimage=\" instead."], + } + ); + # Do not print this warning message multiple times + last; + } } }