2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-20 05:00:34 +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
parent 79e4df3c6b
commit 9b02bb7ca4

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