[svn r38023] Report HostRSyncing only in case where rsyncing is really performed.
--HG-- branch : trunk
This commit is contained in:
parent
540736b493
commit
138b0ec79a
|
@ -91,12 +91,14 @@ class HostRSync(py.execnet.RSync):
|
||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def add_target_host(self, host, destrelpath=None, finishedcallback=None):
|
def add_target_host(self, host, reporter=lambda x: None,
|
||||||
|
destrelpath=None, finishedcallback=None):
|
||||||
key = host.hostname, host.relpath
|
key = host.hostname, host.relpath
|
||||||
if key in self._synced:
|
if key in self._synced:
|
||||||
if finishedcallback:
|
if finishedcallback:
|
||||||
finishedcallback()
|
finishedcallback()
|
||||||
return False
|
return False
|
||||||
|
reporter(repevent.HostRSyncing(host))
|
||||||
self._synced[key] = True
|
self._synced[key] = True
|
||||||
# the follow attributes are set from host.initgateway()
|
# the follow attributes are set from host.initgateway()
|
||||||
gw = host.gw
|
gw = host.gw
|
||||||
|
@ -135,10 +137,9 @@ class HostManager(object):
|
||||||
rsync = HostRSync(ignores=ignores)
|
rsync = HostRSync(ignores=ignores)
|
||||||
destrelpath = root.relto(self.config.topdir)
|
destrelpath = root.relto(self.config.topdir)
|
||||||
for host in self.hosts:
|
for host in self.hosts:
|
||||||
reporter(repevent.HostRSyncing(host))
|
|
||||||
def donecallback():
|
def donecallback():
|
||||||
reporter(repevent.HostRSyncRootReady(host, root))
|
reporter(repevent.HostRSyncRootReady(host, root))
|
||||||
rsync.add_target_host(host, destrelpath,
|
rsync.add_target_host(host, reporter, destrelpath,
|
||||||
finishedcallback=donecallback)
|
finishedcallback=donecallback)
|
||||||
rsync.send(root)
|
rsync.send(root)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue