18db2d3611d35ea9df50bd5773fda2925299a2a4
hiram
  Sat Jan 11 14:44:58 2025 -0800
adding hgwdev-new temporarily for testing on the new hgwdev machine refs #34990

diff --git src/hg/utils/automation/HgAutomate.pm src/hg/utils/automation/HgAutomate.pm
index b4dc82e..eb7c7e0 100755
--- src/hg/utils/automation/HgAutomate.pm
+++ src/hg/utils/automation/HgAutomate.pm
@@ -54,30 +54,33 @@
 sub readMainCluster(); # forward declaration to keep code order
 
 # the name of the cluster is in a separate text file, so it's easier to
 # use from bash scripts
 
 %cluster =
     ( readMainCluster() =>
         { 'enabled' => 1, 'gigaHz' => 1.4, 'ram' => 8,
 	  'hostCount' => 992, },
       'hgwdev-101' =>
         { 'enabled' => 1, 'gigaHz' => 2.1, 'ram' => 1,
 	  'hostCount' => 32, },
       'hgwdev' =>
         { 'enabled' => 1, 'gigaHz' => 2.1, 'ram' => 1,
 	  'hostCount' => 64, },
+      'hgwdev-new' =>
+        { 'enabled' => 1, 'gigaHz' => 2.1, 'ram' => 1,
+	  'hostCount' => 64, },
     );
 
 my %obsoleteCluster =
     ( 'swarm' => ,
         { 'enabled' => 1, 'gigaHz' => 2.33, 'ram' => 8,
 	  'hostCount' => 1024, },
       'memk' =>
         { 'enabled' => 1, 'gigaHz' => 1.0, 'ram' => 32,
 	  'hostCount' => 32, },
       'encodek' =>
         { 'enabled' => 1, 'gigaHz' => 2.0, 'ram' => 16,
 	  'hostCount' => 48, },
     );
 
 my @allClusters = (keys %cluster);
@@ -238,31 +241,31 @@
   verbose(4, "about to run '$cmd'\n");
   my $load = `$cmd`;
   if ($load =~ s/.*load average: (\d+\.\d+).*/$1/) {
     return $load;
   }
   return 1000;
 }
 
 sub getWorkhorseLoads {
   #*** Would be nice to parameterize instead of hardcoding hostnames...
   # Return a hash of workhorses (all idle small cluster machines),
   # associated with their load factors.
   # a valid workhorse needs to have access to hive.
   confess "Too many arguments" if (scalar(@_) != 0);
   my %horses = ();
-  foreach my $machLine ('ku', 'hgwdev') {
+  foreach my $machLine ('ku', 'hgwdev', 'hgwdev-new') {
     my $mach = $machLine;
     $mach =~ s/[\. ].*//;
     chomp $mach;
     $horses{$mach} = &getLoadFactor($mach) if (! exists $horses{$mach});
   }
   return %horses;
 }
 
 sub chooseWorkhorse {
   # Choose a suitable "workhorse" machine.  If -workhorse was given, use that.
   # Otherwise, randomly pick a fast machine with low load factor, or wait if
   # none are available.  This can wait indefinitely, so if it's broken or if
   # all workhorses are down, it's up to the engineer to halt the script.
   confess "Too many arguments" if (shift);
   if ($main::opt_workhorse) {
@@ -288,31 +291,31 @@
     &HgAutomate::verbose(1, "chooseWorkhorse: all machines have high load." .
 			 "  waiting $delay seconds...\n");
     sleep($delay);
   }
 }
 
 sub getFileServer {
   # Use df to determine the fileserver for $path.
   my ($path) = @_;
   confess "Must have exactly 1 argument" if (scalar(@_) != 1);
   my $host = `df $path 2>&1 | grep -v Filesystem`;
   if ($host =~ /(\S+):\/.*/) {
     return $1;
   } else {
     my $localhost = `uname -n`;	# HOST not always present
-    if ($localhost =~ s/^(\w+)(\..*)?$/$1/) {
+    if ($localhost =~ s/^([\w-]+)(\..*)?$/$1/) {
       return $localhost;
     }
   }
   confess "Could not extract server from output of \"df $path\":\n$host\n";
 }
 
 sub canLogin {
   # Return true if logins are enabled on the given fileserver.
   #*** hardcoded
   my ($mach) = @_;
   return ($mach =~ /^kkstore/ || $mach eq 'eieio');
   confess "Must have exactly 1 argument" if (scalar(@_) != 1);
 }
 
 sub chooseFileServer {