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:
parent
7722c15b18
commit
a222012bdc
@ -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} }
|
||||
|
@ -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};
|
||||
|
Loading…
x
Reference in New Issue
Block a user