2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 17:23:08 +00:00

Add EXCEPT: prefix

This commit is contained in:
Mark Gurevich 2018-02-09 11:35:17 -05:00
parent 7722c15b18
commit a222012bdc
2 changed files with 27 additions and 10 deletions

View File

@ -760,11 +760,19 @@ sub preprocess_request {
my $command = $request->{command}->[0];
my $python_env = xCAT::OPENBMC->is_openbmc_python($request->{environment});
# Process command in this module only if PYTHON env is not ALL or command is
# listed in the PYTHON env list. All other cases => return
if (($python_env eq "ALL") ||
(($python_env ne "NO") && ($python_env =~ $command))) {
$request = {};
return;
# listed in the PYTHON env list (without EXCEPT: prefix.
# All other cases => return
SWITCH: {
if ($python_env eq "ALL") {$request = {}; return;}
if ($python_env eq "NO") {last SWITCH;}
if ($python_env !~ $command) {
if ($python_env =~ /^EXCEPT:/) {$request = {}; return;}
else {last SWITCH;}
}
if ($python_env =~ $command) {
if ($python_env =~ /^EXCEPT:/) {last SWITCH;}
else {$request = {}; return;}
}
}
if ($::XCATSITEVALS{xcatdebugmode}) { $xcatdebugmode = $::XCATSITEVALS{xcatdebugmode} }

View File

@ -60,11 +60,20 @@ sub preprocess_request {
my $command = $request->{command}->[0];
my $python_env = xCAT::OPENBMC->is_openbmc_python($request->{environment});
# Process command in this module only if PYTHON env is not NO or
# command is listed in the PYTHON env list. All other cases => return
if (($python_env eq "NO") ||
(($python_env ne "ALL") && ($python_env !~ $command))) {
$request = {};
return;
# command is listed in the PYTHON env list (without EXCEPT: prefix).
# All other cases => return
SWITCH: {
if ($python_env eq "NO") {$request = {}; return;}
if ($python_env eq "ALL") {last SWITCH;}
if ($python_env !~ $command) {
if ($python_env =~ /^EXCEPT:/) {last SWITCH}
else {$request = {}; return;}
}
if ($python_env =~ $command) {
if ($python_env =~ /^EXCEPT:/) {$request = {}; return;}
else {last SWITCH;}
}
}
my $noderange = $request->{node};