From 85081d50ccd26aec9b43357515ae11826a72fb9f Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Wed, 4 Feb 2015 15:36:30 -0500 Subject: [PATCH] Add new service related keyword into site table: consoleservice [Devops Task 10075] The behavior changes between 2.9.1 and 2.10. The keyword is provided for those users who want to try out confluent in the 2.9.1 timeframe. Confluent is planned to be packaged better and the default console for 2.10. conserver will still be shipped to provide console for the systems not supported by confluent. --- perl-xCAT/xCAT/Schema.pm | 1 + xCAT-server/lib/xcat/plugins/confluent.pm | 10 ++++++++++ xCAT-server/lib/xcat/plugins/conserver.pm | 14 ++++++++++++-- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index a41d42724..84e3c31c3 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -1129,6 +1129,7 @@ site => { " consoleondemand: When set to 'yes', conserver connects and creates the console\n". " output only when the user opens the console. Default is no on\n". " Linux, yes on AIX.\n\n". + " consoleservice: The console service to be used by xCAT. Default is conserver\n\n", " httpport: The port number that the booting/installing nodes should contact the\n". " http server on the MN/SN on. It is your responsibility to configure\n". " the http server to listen on that port - xCAT will not do that.\n\n". diff --git a/xCAT-server/lib/xcat/plugins/confluent.pm b/xCAT-server/lib/xcat/plugins/confluent.pm index 26291a6d9..ae3c2aadd 100644 --- a/xCAT-server/lib/xcat/plugins/confluent.pm +++ b/xCAT-server/lib/xcat/plugins/confluent.pm @@ -97,6 +97,16 @@ sub preprocess_request { return; } + # + # check the site "consoleservice" configuration. + # 2.9.X, if not defined, do not allow makeconfluentcfg run (default is conserver) + # if defined and NOT confluent, prevent this command from running + my $consoleservice=xCAT::TableUtils->get_site_attribute("consoleservice"); + if (!$consoleservice || $consoleservice ne "confluent") { + $callback->({data=>"ERROR: confluent is not configured as the xCAT console service in the site table. \nConfigure consoleservice=confluent and install xCAT-confluent."}); + $request = {}; + return; + } # get site master my $master=xCAT::TableUtils->get_site_Master(); diff --git a/xCAT-server/lib/xcat/plugins/conserver.pm b/xCAT-server/lib/xcat/plugins/conserver.pm index 398f4bf2e..d316231d3 100644 --- a/xCAT-server/lib/xcat/plugins/conserver.pm +++ b/xCAT-server/lib/xcat/plugins/conserver.pm @@ -96,8 +96,18 @@ sub preprocess_request { $request = {}; return; } - - + + # + # check the site "consoleservice" configuration. + # 2.9.X, if not defined, default to conserver + # if defined and confluent, prevent this command from running + my $consoleservice=xCAT::TableUtils->get_site_attribute("consoleservice"); + if ($consoleservice && $consoleservice eq "confluent") { + $callback->({data=>"ERROR: confluent is configured as the xCAT console service in the site table, try makeconfluentcfg"}); + $request = {}; + return; + } + # get site master my $master=xCAT::TableUtils->get_site_Master(); if (!$master) { $master=hostname(); }