From 120dae77498847d98391e14ff4b5757b0f85ad4a Mon Sep 17 00:00:00 2001 From: fijal Date: Thu, 8 Feb 2007 16:54:53 +0100 Subject: [PATCH] [svn r38172] Add a method which sends only if there are available targets --HG-- branch : trunk --- py/execnet/rsync.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/py/execnet/rsync.py b/py/execnet/rsync.py index 888af3f59..c79dffc1a 100644 --- a/py/execnet/rsync.py +++ b/py/execnet/rsync.py @@ -93,6 +93,13 @@ class RSync(object): if self._verbose: print '%s <= %s' % (gateway.remoteaddress, modified_rel_path) + def send_if_targets(self): + """ Sends only if there are targets, otherwise returns + """ + if not self._channels: + return + self.send() + def send(self): """ Sends a sourcedir to all added targets. """