2
0
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:
Yuan Bai
2018-08-02 11:22:43 +08:00
committed by Gᴏɴɢ Jie
parent 924a7a0373
commit ccc69fc330

View File

@ -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;