]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
cr-ensure-disk-space: Permit argument to specify local directory.
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 9 Mar 2015 16:22:58 +0000 (12:22 -0400)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 24 Mar 2015 18:57:00 +0000 (18:57 +0000)
If the argument is Logs rather than LogsPublish (ie, refers to a local
directory (without `:') rather than a remote one (with `:'), do things
locally (by invoking sh -ec so that we have identical quoting rules to
ssh).

No effectively functional change with the current configuration.

We still always do a local deletion.  This is anomalous and will
disappear shortly.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
cr-ensure-disk-space

index 1c665b31268bf239557ded82651147b8baf54ebe..1defa6ae0923291ca1845a6466500e975edde061 100755 (executable)
@@ -53,13 +53,22 @@ our @flights;
 our @sshopts= qw(-o batchmode=yes);
 
 my $cfgvalue = $c{$cfgbase};
-$cgvvalue =~ m/\:/ or die "$c{LogsPublish} ?";
-my ($pubhost, $pubdir) = ($`,$'); #';
+
+my ($pubhost, $pubdir);
+if ($cfgvalue =~ m/\:/) {
+    ($pubhost, $pubdir) = ($`,$'); #');
+} else {
+    ($pubhost, $pubdir) = (undef, $cfgvalue);
+}
 
 sub ontarget ($) {
     my ($shellcmd) = @_;
     # returns list to run that command
-    return qw(ssh -n), @sshopts, $pubhost, $shellcmd;
+    if (defined $pubhost) {
+       return qw(ssh -n), @sshopts, $pubhost, $shellcmd;
+    } else {
+       return qw(sh -ec), $shellcmd;
+    }
 }
 
 for (;;) {