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

[Xen-devel] [OSSTEST PATCH 07/13] target_jobdir: Create the directory



Callers of target_jobdir can now rely on the directory existing after
it returns.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 Osstest/TestSupport.pm |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index d72a02c..6dd0247 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -1709,9 +1709,15 @@ END
 
 sub target_jobdir ($) {
     my ($ho) = @_;
-    my $leaf= "build.$flight.$job";
-    my $homedir = get_host_property($ho, 'homedir', '/home/osstest');
-    return "$homedir/$leaf";
+    my $jobdir = $ho->{JobDir};
+    if (!$jobdir) {
+       my $leaf= "build.$flight.$job";
+       my $homedir = get_host_property($ho, 'homedir', '/home/osstest');
+       $jobdir = "$homedir/$leaf";
+       target_cmd($ho, "mkdir -p $jobdir", 60);
+       $ho->{JobDir} = $jobdir;
+    }
+    return $jobdir;
 }
 
 sub target_extract_jobdistpath_subdir ($$$$) {
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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