From ac7ae1fccca374de90415469261c5add4fc32bd8 Mon Sep 17 00:00:00 2001 From: Thomas S Hatch Date: Thu, 8 Nov 2012 09:39:51 -0700 Subject: [PATCH] Add the ext_job_cache to the peer calls --- salt/master.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/salt/master.py b/salt/master.py index 3db71c0002..329921319d 100644 --- a/salt/master.py +++ b/salt/master.py @@ -526,6 +526,8 @@ class AESFuncs(object): self.tops = salt.loader.tops(self.opts) # Make a client self.local = salt.client.LocalClient(self.opts['conf_file']) + # Create the master minion to access the external job cache + self.mminion = salt.minion.MasterMinion(self.opts) def __find_file(self, path, env='base'): ''' @@ -995,6 +997,16 @@ class AESFuncs(object): ), 'w+') ) + # Save the load to the ext_job_cace if it is turned on + if self.opts['ext_job_cache']: + try: + fstr = '{0}.save_load'.format(self.opts['ext_job_cache']) + self.mminion.returners[fstr](clear_load['jid'], clear_load) + except KeyError: + msg = ('The specified returner used for the external job ' + 'cache "{0}" does not have a save_load function!' + ).format(self.opts['ext_job_cache']) + log.critical(msg) payload = {'enc': 'aes'} expr_form = 'glob' timeout = 5