mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-06-14 18:30:23 +00:00
remind incorrect syntax in object name regular expression (#5455)
Remind incorrect syntax in object name regular expression
This commit is contained in:
@ -3922,6 +3922,16 @@ sub defls
|
||||
# the object names are passed in through command line
|
||||
if ($::objectsfrom_args || $::opt_o || (($type eq 'node') && ($::opt_o || @::noderange)))
|
||||
{
|
||||
|
||||
eval { /$obj/ };
|
||||
if ($@)
|
||||
{
|
||||
my $rsp = {};
|
||||
$rsp->{data}->[0] = "Invalid \'$obj\' name, check the object named \'$obj\' of type \'$type\' syntax.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::callback);
|
||||
next;
|
||||
}
|
||||
|
||||
if (!grep(/^$obj$/, @allobjoftype))
|
||||
{
|
||||
my $rsp;
|
||||
|
Reference in New Issue
Block a user