]> xenbits.xensource.com Git - people/royger/osstest.git/commitdiff
cr-publish-flight-logs: Refactor copydir args
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 11 Jul 2018 11:02:26 +0000 (12:02 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 11 Jul 2018 14:55:15 +0000 (15:55 +0100)
Have it take $cfgbase and $subdir instead.  This allows us to lift the
config test into it.  And it will be even more useful in a moment.

No functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
cr-publish-flight-logs

index 1e5a49df764aa5824193513eca6edc6363af55f4..539318dc692605f8f405ca80d70fcdd4b39f0dd5 100755 (executable)
@@ -57,7 +57,10 @@ if ($push_harness) {
 }
 
 sub copydir ($$) {
-    my ($src,$dst) = @_;
+    my ($cfgbase,$subdir) = @_;
+    return unless $c{"${cfgbase}Publish"};
+    my $src = $c{$cfgbase}.$subdir."/";
+    my $dst = $c{"${cfgbase}Publish"}.$subdir;
     my @cmd= qw(rsync --compress --compress-level=9 --stats --delete -auH);
     push @cmd, '-e', 'ssh -o batchmode=yes';
     #--bwlimit=50
@@ -66,6 +69,5 @@ sub copydir ($$) {
     $!=0; $?=0; system @cmd; die "rsync $? $!" if $? or $!;
 }
 
-copydir("$c{Logs}/$flight/", "$c{LogsPublish}/$flight")
-    if $flight && $c{LogsPublish};
-copydir("$c{Results}/", "$c{ResultsPublish}") if $c{ResultsPublish};
+copydir(qw(Logs), "/$flight") if $flight;
+copydir(qw(Results), '');