diff --git a/xCAT-server/lib/xcat/plugins/hosts.pm b/xCAT-server/lib/xcat/plugins/hosts.pm index 609c6028b..096aa4e15 100755 --- a/xCAT-server/lib/xcat/plugins/hosts.pm +++ b/xCAT-server/lib/xcat/plugins/hosts.pm @@ -122,6 +122,10 @@ sub build_line my $othernames = shift; my @o_names = (); my @n_names = (); + + # Trim spaces from the beginning and end from $othernames + $othernames =~ s/^\s+|\s+$//g; + if (defined $othernames) { # the "hostnames" attribute can be a list delimited by