Index: /trunk/pstamp/scripts/pstamp_listjobs.pl
===================================================================
--- /trunk/pstamp/scripts/pstamp_listjobs.pl	(revision 16975)
+++ /trunk/pstamp/scripts/pstamp_listjobs.pl	(revision 16976)
@@ -68,5 +68,5 @@
     if (@$stdout_buf == 0) {
         print STDERR "no pstamp jobs for request $request_id\n";
-        exit 1;
+        exit 0;
     }
     my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
@@ -79,5 +79,5 @@
 
 if (! @psjobs) {
-    print STDERR "no postage stamp jobs for request $request_id found\n";
+    print STDERR "no postage stamp jobs for request $request_id\n";
     exit 0;
 }
@@ -86,14 +86,23 @@
     #
     # convert from filename to data store relative uri
-    # XXX arguably we shouldn't do this here. this should be a function
-    # of the web interface. But since this script is only used by
-    # the web interface ....
+    # XXX arguably we shouldn't do this here.
+    # This should be a function of the web interface. However, since this script
+    # is only used by the web interface ....
     my $i = index($job->{outputBase}, "dsroot/");
+
+    my $add_fits = 0;
+    if ($job->{jobType} ne "get_image") {
+        $add_fits = 1;
+    }
 
     my $uri;
     if ($i > 0) {
-        $uri = "/ds" . substr($job->{outputBase}, $i + 6) . ".fits";
+        $uri = "/ds" . substr($job->{outputBase}, $i + 6);
     } else {
-        $uri = "$job->{outputBase}" . ".fits";
+        $uri = "$job->{outputBase}";
+    }
+
+    if ($add_fits) {
+        $uri .= ".fits";
     }
 
