diff --git a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm index 41ae75076..43cd7c231 100644 --- a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm @@ -891,6 +891,19 @@ sub defmk xCAT::MsgUtils->message("E", $rsp, $::callback); &defmk_usage; return 1; + } else { + my $invalidnodename = (); + foreach my $node (@::allobjnames) { + if ($node =~ /[A-Z]/) { + $invalidnodename .= ",$node"; + } + } + if ($invalidnodename) { + $invalidnodename =~ s/,//; + my $rsp; + $rsp->{data}->[0] = "The node name \'$invalidnodename\' has capital which can not be resolved correctly by dns server. Please don't use the capital in the node name which need to be installed Operating System."; + xCAT::MsgUtils->message("W", $rsp, $::callback); + } } # set $objtype & fill in cmd line hash @@ -2090,14 +2103,30 @@ sub defch xCAT::MsgUtils->message("I", $rsp, $::callback); if (scalar(keys %newobjects) > 0) { - my $newobj = join(',', sort(keys %newobjects)); - my $rsp; - $rsp->{data}->[0] = "New object definitions \'$newobj\' have been created."; - xCAT::MsgUtils->message("I", $rsp, $::callback); + my $newobj = (); + my $invalidnodename = (); + foreach my $node (keys %newobjects) { + if ($node =~ /[A-Z]/) { + $invalidnodename .= ",$node"; + } + $newobj .= ",$node"; + } + + if ($newobj) { + $newobj =~ s/,//; + my $rsp; + $rsp->{data}->[0] = "New object definitions \'$newobj\' have been created."; + xCAT::MsgUtils->message("I", $rsp, $::callback); + } + if ($invalidnodename) { + $invalidnodename =~ s/,//; + my $rsp; + $rsp->{data}->[0] = "The node name \'$invalidnodename\' has capital which can not be resolved correctly by dns server. Please don't use the capital in the node name which need to be installed Operating System."; + xCAT::MsgUtils->message("W", $rsp, $::callback); + } + } - - - } + } return 0; } } diff --git a/xCAT-server/lib/xcat/plugins/tabutils.pm b/xCAT-server/lib/xcat/plugins/tabutils.pm index 923037d46..4d9d6b417 100644 --- a/xCAT-server/lib/xcat/plugins/tabutils.pm +++ b/xCAT-server/lib/xcat/plugins/tabutils.pm @@ -778,6 +778,17 @@ sub nodech $callback->({error => "No noderange to add.\n",errorcode=>1}); return; } + + my $invalidnodename = (); + foreach my $node (@$nodes) { + if ($node =~ /[A-Z]/) { + $invalidnodename .= ",$node"; + } + } + if ($invalidnodename) { + $invalidnodename =~ s/,//; + $callback->( {warning => "The node name \'$invalidnodename\' has capital which can not be resolved correctly by dns server. Please don't use the capital in the node name which need to be installed Operating System.\n"} ); + } } elsif ($groupmode) { @groups = split /,/, shift @ARGV; }