2
0
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:
Samveen Gulati
2015-09-13 07:11:56 +00:00
committed by GONG Jie
parent 623dedbf8a
commit 655a180ff7

View File

@ -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 = ();