def _crypted_transfer(self, load, tries=3, timeout=60):
    '\n        In case of authentication errors, try to renegotiate authentication\n        and retry the method.\n        Indeed, we can fail too early in case of a master restart during a\n        minion state execution call\n        '

    def _do_transfer():
        data = self.sreq.send(self.crypt, self.auth.crypticle.dumps(load), tries, timeout)
        if data:
            data = self.auth.crypticle.loads(data)
        return data
    try:
        return _do_transfer()
    except salt.crypt.AuthenticationError:
        self.auth = salt.crypt.SAuth(self.opts)
        return _do_transfer()
In case of authentication errors, try to renegotiate authentication
and retry the method.
Indeed, we can fail too early in case of a master restart during a
minion state execution call
def _crypted_transfer(self, load, tries=3, timeout=60):
    '\n        In case of authentication errors, try to renegotiate authentication\n        and retry the method.\n        Indeed, we can fail too early in case of a master restart during a\n        minion state execution call\n        '

    def _do_transfer():
        data = self.sreq.send(self.crypt, self.auth.crypticle.dumps(load), tries, timeout)
        if data:
            data = self.auth.crypticle.loads(data)
        return data
    try:
        return _do_transfer()
    except salt.crypt.AuthenticationError:
        self.auth = salt.crypt.SAuth(self.opts)
        return _do_transfer()