From d034005e811be414909c3ab5b211500d20e2c6b6 Mon Sep 17 00:00:00 2001 From: cxhong Date: Mon, 28 Oct 2019 14:33:54 -0400 Subject: [PATCH] Error message if running kits on rhel8 --- xCAT-buildkit/bin/buildkit | 7 +++++++ xCAT-server/lib/xcat/plugins/kit.pm | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/xCAT-buildkit/bin/buildkit b/xCAT-buildkit/bin/buildkit index eb119cde1..4842e47ed 100755 --- a/xCAT-buildkit/bin/buildkit +++ b/xCAT-buildkit/bin/buildkit @@ -344,6 +344,13 @@ if ($tempstring =~ /debian/ || $tempstring =~ /ubuntu/) { $debianflag = 1; } +my ($sysos, $sysver) = split /,/, $tempstring; +if ( ($sysos =~ /rh/) && ($sysver ge 8) ) { + print "ERROR: KITs are not supported on rhel8 or above\n"; + exit(1); +} + + # This is an undocumented flag to support our local build team # to allow building Ubuntu kits on our RH build machines. # It requires RH rpms such as dep, fakeroot, perl-File-DesktopEntry, diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index 2b1a0d6c4..d61cebbde 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -33,7 +33,7 @@ $::KITFRAMEWORK = "2"; $::COMPATIBLE_KITFRAMEWORKS = "0,1,2"; my $debianflag = 0; -my $tempstring = xCAT::Utils->osver(); +my $tempstring = xCAT::Utils->osver(all); if ($tempstring =~ /debian/ || $tempstring =~ /ubuntu/) { $debianflag = 1; @@ -99,6 +99,12 @@ sub process_request $::PID = $$; } + my ($sysos, $sysver) = split /,/, $tempstring; + if ( ($sysos =~ /rh/) && ($sysver ge 8) ) { + $callback->({ error => ["KITs are not supported on rhel8 or above"], errorcode => [1] }); + return 1; + } + my $command = $request->{command}->[0]; my $rc;