mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-06-13 01:40:26 +00:00
[xCAT-server]Add check for existing target names for chdef -n
This commit is contained in:
@ -1842,6 +1842,14 @@ sub defch
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Ensure that the target object doesn't exist
|
||||
if (grep /^$::opt_n$/, @validnode) {
|
||||
my $rsp;
|
||||
push @{$rsp->{data}}, "Object $::opt_n already exists.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::callback);
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Use the getobjdefs function to get a hash which including
|
||||
# all the records in the table that should be changed
|
||||
my %chnamehash = ();
|
||||
|
Reference in New Issue
Block a user