2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-22 03:32:04 +00:00

Failed to parse the prescripts without action defined (#5682)

This commit is contained in:
cxhong 2018-10-09 01:49:15 -04:00 committed by Bin Xu
parent 7bf2984138
commit 017ab78ba5

View File

@ -426,21 +426,19 @@ sub parseprescripts
my $scripts = shift;
my $action = shift;
my $ret;
if ($scripts) {
if ($scripts =~ /:/) {
my @a = split(/\|/, $scripts);
foreach my $token (@a) {
#print "token=$token, action=$action\n";
if ($scripts) {
foreach my $token (split(/\|/, $scripts)) {
if ($token =~ /:/) {
if ($token =~ /^$action:(.*)/) {
$ret = $1;
last;
$ret .= "$1,";
}
} else {
$ret .= "$token,";
}
} else {
$ret = $scripts;
}
}
return $ret;
}