]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
Executive: Break out task_spec_desc (no functional change)
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 6 Oct 2016 15:48:53 +0000 (16:48 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 10 Oct 2016 11:13:14 +0000 (12:13 +0100)
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Osstest/Executive.pm

index 850606db5e3b8de12b719b16b530aefb6f6933db..8c2c4d7ff915229c89dbc7934cf0c73f0a5235e1 100644 (file)
@@ -45,7 +45,7 @@ BEGIN {
     $VERSION     = 1.00;
     @ISA         = qw(Exporter);
     @EXPORT      = qw(grabrepolock_reexec
-                      findtask findtask_spec @all_lock_tables
+                      task_spec_desc findtask findtask_spec @all_lock_tables
                       restrictflight_arg restrictflight_cond
                       report_run_getinfo report_altcolour
                       report_altchangecolour
@@ -524,6 +524,20 @@ END
 
 our $taskid;
 
+sub task_spec_desc ($) {
+    my ($row) = @_; # NB row maybe modifed, to fill in username and comment
+    # => ($newspec, $desc);
+
+    foreach my $k (qw(username comment)) {
+        next if defined $row->{$k};
+        $row->{$k}= "[no $k]";
+    }
+
+    my $newspec = "$row->{taskid} $row->{type} $row->{refkey}";
+    my $desc = "$row->{username} $row->{comment}";
+    return ($newspec,$desc);
+}
+
 sub findtask_spec ($$) {
     my ($spec, $why) = @_;
 
@@ -556,13 +570,8 @@ END
     die "task $what dead" unless $row->{live};
     $q->finish();
 
-    foreach my $k (qw(username comment)) {
-        next if defined $row->{$k};
-        $row->{$k}= "[no $k]";
-    }
-
-    my $newspec= "$row->{taskid} $row->{type} $row->{refkey}";
-    logm("${why}task $newspec: $row->{username} $row->{comment}");
+    my ($newspec, $desc) = task_spec_desc($row);
+    logm("${why}task $newspec: $desc");
 
     $taskid= $row->{taskid};