[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 3/8] cr-publish-flight-logs: Refactor copydir args



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@xxxxxxxxxxxxx>
---
 cr-publish-flight-logs | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/cr-publish-flight-logs b/cr-publish-flight-logs
index 1e5a49d..539318d 100755
--- a/cr-publish-flight-logs
+++ b/cr-publish-flight-logs
@@ -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), '');
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.