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

[Xen-devel] [OSSTEST PATCH 17/32] cr-ensure-disk-space: Break out ontarget



No functional change.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 cr-ensure-disk-space |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/cr-ensure-disk-space b/cr-ensure-disk-space
index ff07b76..31880f7 100755
--- a/cr-ensure-disk-space
+++ b/cr-ensure-disk-space
@@ -53,6 +53,12 @@ our @sshopts= qw(-o batchmode=yes);
 $c{LogsPublish} =~ m/\:/ or die "$c{LogsPublish} ?";
 my ($pubhost, $pubdir) = ($`,$'); #';
 
+sub ontarget ($) {
+    my ($shellcmd) = @_;
+    # returns list to run that command
+    return qw(ssh -n), @sshopts, $pubhost, $shellcmd;
+}
+
 for (;;) {
     open P, "df --block-size=1M -P . |" or die $!;
     $_= <P>;
@@ -91,7 +97,7 @@ for (;;) {
     my $spawn= sub {
         $!=0; my $r= system @_; die "@_ $r $!" if $r;
     };
-    $spawn->(qw(ssh -n), @sshopts, $pubhost, <<END);
+    $spawn->(ontarget <<END);
              set -e
              cd $pubdir
              test -e $flight || exit 0
-- 
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®.