diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index ca041f245..c1953da95 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -528,12 +528,9 @@ sub isLinux #------------------------------------------------------------------------------- sub Version { - - #The following tag tells the build script where to append build info my $version = shift; $version = xCAT::Version->Version(); return $version; - } #------------------------------------------------------------------------------- diff --git a/perl-xCAT/xCAT/Version.pm b/perl-xCAT/xCAT/Version.pm index 787f4139c..99fe9c4f2 100644 --- a/perl-xCAT/xCAT/Version.pm +++ b/perl-xCAT/xCAT/Version.pm @@ -38,7 +38,7 @@ use strict; sub Version { - #The following tag tells the build script where to append build info + #The following tags tells the build script where to append build info my $version = shift; if ($version eq 'short') { diff --git a/perl-xCAT/xCAT/hpoa.pm b/perl-xCAT/xCAT/hpoa.pm index 817eaaca4..12f9f266a 100644 --- a/perl-xCAT/xCAT/hpoa.pm +++ b/perl-xCAT/xCAT/hpoa.pm @@ -14,7 +14,7 @@ package xCAT::hpoa; use strict; -use SOAP::Lite; +#use SOAP::Lite; # hpblade.pm requires SOAP::Lite before requiring hpoa.pm, so we can check for SOAP::Lite dynamically use vars qw(@ISA); @ISA = qw(SOAP::Lite); diff --git a/xCAT-server/lib/xcat/plugins/AAsn.pm b/xCAT-server/lib/xcat/plugins/AAsn.pm index 0782a11f3..3224189f7 100644 --- a/xCAT-server/lib/xcat/plugins/AAsn.pm +++ b/xCAT-server/lib/xcat/plugins/AAsn.pm @@ -271,10 +271,9 @@ sub init_plugin # $rc = &setup_NTPmn(); # setup NTP on the Management Node if (xCAT::Utils->isLinux()) { - print "\n" - ; # make OK prints look better. Only need to do this for the 1st service. my @tmp = xCAT::TableUtils->get_site_attribute("vsftp"); if ($tmp[0] && ($tmp[0] !~ /0|NO|No|no|N|n/ )) { + print "\n"; # make OK prints look better. Only need to do this for the 1st service. $rc = &setup_FTP(); # setup FTP } #enable the tftp-hpa for MN diff --git a/xCAT-server/lib/xcat/plugins/hpblade.pm b/xCAT-server/lib/xcat/plugins/hpblade.pm index 4b9c41180..2f7b2c7e5 100755 --- a/xCAT-server/lib/xcat/plugins/hpblade.pm +++ b/xCAT-server/lib/xcat/plugins/hpblade.pm @@ -30,7 +30,7 @@ use Net::SSLeay qw(die_now die_if_ssl_error); use Data::Dumper; use POSIX "WNOHANG"; use Getopt::Long; -use xCAT::hpoa; +#use xCAT::hpoa; # require this dynamically below instead sub handled_commands { return { @@ -326,6 +326,14 @@ sub preprocess_request { $request = {}; return; } + + # require SOAP::Lite for hpoa.pm so we can do it dynamically + my $soapsupport = eval { require SOAP::Lite; }; + unless ($soapsupport) { #Still no SOAP::Lite module + $callback->({error=>"SOAP::Lite perl module missing. Install perl-SOAP-Lite before running HP blade commands.",errorcode=>[42]}); + return []; + } + require xCAT::hpoa; #get the MMs for the nodes for the nodes in order to figure out which service nodes to send the requests to my $mptab = xCAT::Table->new("mp"); @@ -600,6 +608,15 @@ sub process_request { unless ($command) { return; #Empty request } + + # require SOAP::Lite for hpoa.pm so we can do it dynamically + my $soapsupport = eval { require SOAP::Lite; }; + unless ($soapsupport) { #Still no SOAP::Lite module + $callback->({error=>"SOAP::Lite perl module missing. Install perl-SOAP-Lite before running HP blade commands.",errorcode=>[42]}); + return []; + } + require xCAT::hpoa; + if (ref($request->{arg})) { @exargs = @{$request->{arg}}; } else { diff --git a/xCAT-server/xCAT-wsapi/xcatws.cgi b/xCAT-server/xCAT-wsapi/xcatws.cgi index e394a8973..f50659f1b 100755 --- a/xCAT-server/xCAT-wsapi/xcatws.cgi +++ b/xCAT-server/xCAT-wsapi/xcatws.cgi @@ -1,7 +1,7 @@ #!/usr/bin/perl use strict; use CGI qw/:standard/; -use JSON; +#use JSON; # require this dynamically later on so that installations that do not use xcatws.cgi do not need perl-JSON use Data::Dumper; #added the line: @@ -103,6 +103,15 @@ if ($queryhash{'format'}) { addPageContent("The format '$format' is not valid"); sendResponseMsg($STATUS_BAD_REQUEST); } + + if ($format eq 'json') { + # require JSON dynamically and let them know if it is not installed + my $jsoninstalled = eval { require JSON; }; + unless ($jsoninstalled) { + addPageContent($q->p("JSON perl module missing. Install perl-JSON before using the xCAT REST web services API.")); + sendResponseMsg($STATUS_SERVICE_UNAVAILABLE); + } + } } my $XCAT_PATH = '/opt/xcat/bin'; diff --git a/xCAT/xCAT.spec b/xCAT/xCAT.spec index 155a0b570..058a13a1d 100644 --- a/xCAT/xCAT.spec +++ b/xCAT/xCAT.spec @@ -27,6 +27,8 @@ Requires: xCAT-server xCAT-client perl-DBD-SQLite Requires: httpd nfs-utils nmap bind perl-XML-Parser perl(CGI) # On RHEL this pulls in dhcp, on SLES it pulls in dhcp-server Requires: /usr/sbin/dhcpd +# On RHEL this pulls in openssh-server, on SLES it pulls in openssh +Requires: /usr/bin/ssh %ifnarch s390x Requires: /etc/xinetd.d/tftp # yaboot-xcat is pulled in so any MN can manage ppc nodes