mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #23154 from cachedout/refresh_channel
Re-establish channel on interruption in fileclient
This commit is contained in:
commit
168508ec2a
1 changed files with 8 additions and 0 deletions
|
@ -916,6 +916,13 @@ class RemoteClient(Client):
|
|||
return self.channel
|
||||
return salt.transport.Channel.factory(self.opts)
|
||||
|
||||
def _refresh_channel(self):
|
||||
'''
|
||||
Reset the channel, in the event of an interruption
|
||||
'''
|
||||
self.channel = salt.transport.Channel.factory(self.opts)
|
||||
return self.channel
|
||||
|
||||
def get_file(self,
|
||||
path,
|
||||
dest='',
|
||||
|
@ -990,6 +997,7 @@ class RemoteClient(Client):
|
|||
data = self.channel.send(load)
|
||||
if 'data' not in data:
|
||||
log.error('Data is {0}'.format(data))
|
||||
self._refresh_channel()
|
||||
if not data['data']:
|
||||
if not fn_ and data['dest']:
|
||||
# This is a 0 byte file on the master
|
||||
|
|
Loading…
Add table
Reference in a new issue