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.jack...@eu.citrix.com>
---
 cr-ensure-disk-space |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/cr-ensure-disk-space b/cr-ensure-disk-space
index 1c665b3..1defa6a 100755
--- a/cr-ensure-disk-space
+++ b/cr-ensure-disk-space
@@ -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 (;;) {
-- 
1.7.10.4


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

Reply via email to