Merge pull request #23154 from cachedout/refresh_channel

Re-establish channel on interruption in fileclient
This commit is contained in:
Justin Findlay 2015-04-29 10:18:59 -06:00
commit 168508ec2a

View file

@ -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