diff --git a/perl-xCAT/xCAT/InstUtils.pm b/perl-xCAT/xCAT/InstUtils.pm index dcc0e5899..aeb3052a3 100644 --- a/perl-xCAT/xCAT/InstUtils.pm +++ b/perl-xCAT/xCAT/InstUtils.pm @@ -151,6 +151,10 @@ sub myxCATname } } + if (!$name) { + $name = hostname(); + } + my $shorthost; ($shorthost = $name) =~ s/\..*$//; chomp $shorthost; diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index 97348a12b..6bbafec18 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -1037,7 +1037,6 @@ sub runcmd # get this systems name as known by xCAT management node my $Sname = xCAT::InstUtils->myxCATname(); - chomp $Sname; if ($::VERBOSE) {