Index: trunk/ippScripts/scripts/register_imfile.pl
===================================================================
--- trunk/ippScripts/scripts/register_imfile.pl	(revision 17671)
+++ trunk/ippScripts/scripts/register_imfile.pl	(revision 17803)
@@ -52,6 +52,6 @@
 
 # values to extract from output metadata and the stats to calculate
-my $STATS = 
-   [   
+my $STATS =
+   [
        #          PPSTATS KEYWORD         STATISTIC          CHIPTOOL FLAG
        { name => "FILE.LEVEL",     type => "constant", flag => "-filelevel",       dtype => "string" }, # File level
@@ -69,5 +69,5 @@
        { name => "FPA.TIME",       type => "constant", flag => "-dateobs",         dtype => "string" }, # Date of observation (UTC)
        { name => "FPA.TELESCOPE",  type => "constant", flag => "-telescope",       dtype => "string" }, # Telescope
-       { name => "FPA.INSTRUMENT", type => "constant", flag => "-inst",            dtype => "string" }, # Instrument 
+       { name => "FPA.INSTRUMENT", type => "constant", flag => "-inst",            dtype => "string" }, # Instrument
        { name => "FPA.M1X",        type => "constant", flag => "-m1_x",            dtype => "float"  }, # M1X
        { name => "FPA.M1Y",        type => "constant", flag => "-m1_y",            dtype => "float"  }, # M1Y
@@ -85,10 +85,10 @@
        { name => "FPA.ENV.DIR",    type => "constant", flag => "-env_wind_dir",    dtype => "float"  }, # external wind direction
 
-       { name => "FPA.TELTEMP.M1",     type => "constant", flag => "-teltemp_m1",     dtype => "float"  }, # Primary mirror temps (C) 		
-       { name => "FPA.TELTEMP.M1CELL", type => "constant", flag => "-teltemp_m1cell", dtype => "float"  }, # Primary mirror support temps (C)   
-       { name => "FPA.TELTEMP.M2",     type => "constant", flag => "-teltemp_m2",     dtype => "float"  }, # Secondary mirror temps (C		
-       { name => "FPA.TELTEMP.SPIDER", type => "constant", flag => "-teltemp_spider", dtype => "float"  }, # Spider temperatures (C)  		
-       { name => "FPA.TELTEMP.TRUSS",  type => "constant", flag => "-teltemp_truss",  dtype => "float"  }, # Mid truss temperatures (C		
-       { name => "FPA.TELTEMP.EXTRA",  type => "constant", flag => "-teltemp_extra",  dtype => "float"  }, # Miscellaneous temperatures (C)     
+       { name => "FPA.TELTEMP.M1",     type => "constant", flag => "-teltemp_m1",     dtype => "float"  }, # Primary mirror temps (C)
+       { name => "FPA.TELTEMP.M1CELL", type => "constant", flag => "-teltemp_m1cell", dtype => "float"  }, # Primary mirror support temps (C)
+       { name => "FPA.TELTEMP.M2",     type => "constant", flag => "-teltemp_m2",     dtype => "float"  }, # Secondary mirror temps (C
+       { name => "FPA.TELTEMP.SPIDER", type => "constant", flag => "-teltemp_spider", dtype => "float"  }, # Spider temperatures (C)
+       { name => "FPA.TELTEMP.TRUSS",  type => "constant", flag => "-teltemp_truss",  dtype => "float"  }, # Mid truss temperatures (C
+       { name => "FPA.TELTEMP.EXTRA",  type => "constant", flag => "-teltemp_extra",  dtype => "float"  }, # Miscellaneous temperatures (C)
 
        { name => "FPA.PON.TIME",   type => "constant", flag => "-pon_time",        dtype => "float"  }, # time since last power on
@@ -109,7 +109,7 @@
     or (warn "Can't find ppStats" and $missing_tools = 1);
 
-if ($missing_tools) { 
+if ($missing_tools) {
     warn ("Can't find required tools");
-    exit($PS_EXIT_CONFIG_ERROR); 
+    exit($PS_EXIT_CONFIG_ERROR);
 }
 
@@ -130,9 +130,9 @@
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
         cache_run(command => $command, verbose => $verbose);
-    unless ($success) { 
+    unless ($success) {
         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
         &my_die ("Unable to perform ppStats on exposure id $exp_id: $error_code", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $error_code);
     }
-    
+
     # Parse the output
     my $mdcParser = PS::IPP::Metadata::Config->new;        # Parser for metadata config files
@@ -163,4 +163,5 @@
 $command .= " -tmp_class_id $tmp_class_id"; # the original class_id supplied by the user, replace by ppStats CLASS.ID
 $command .= " -uri $uri ";
+$command .= " -hostname $host" if defined $host;
 $command .= " -dbname $dbname" if defined $dbname;
 $command .= $stats->cmdflags();
@@ -216,9 +217,10 @@
         $command .= " -exp_name $exp_name";
         $command .= " -tmp_class_id $tmp_class_id";
-	$command .= " -uri $uri ";
+        $command .= " -uri $uri ";
         $command .= " -telescope UNKNOWN";
         $command .= " -inst UNKNOWN";
         $command .= " -class_id $tmp_class_id";
         $command .= " -code $exit_code";
+        $command .= " -hostname $host" if defined $host;
         $command .= " -dbname $dbname" if defined $dbname;
         system ($command);
