old_contents: # -*- coding: utf-8 -*-
  '''
  The dummy publisher for the Salt Master
  
  Contains functionality to short-circuit a salt-master's
  publish functionality so that instead of publications being
  sent across the wire, they are instead transparently redirected
  to a returner.
  
  Designed for use primarily in load-testing the salt-master
  without the need for a swarm of real minions.
  '''
  
  # pylint: disable=W0232
  
  # Import python libs
  from __future__ import absolute_import
  import logging
  
  # Import salt libs
  import ioflo.base.deeding
  import salt.daemons.flo.worker
  from raet import raeting
  from raet.lane.stacking import LaneStack
  from raet.lane.yarding import RemoteYard
  
  log = logging.getLogger(__name__)
  
  
  class SaltDummyPublisher(ioflo.base.deeding.Deed):
      '''
      A dummy publisher that transparently redirects publications to 
      a translation system to have them mocked up and sent back into a router
      '''
      Ioinits = {
              'opts': '.salt.opts',
              'publish': '.salt.var.publish',
              'lane_stack': '.salt.lane.manor.stack',
              }
  
      def action(self):
          while self.publish.value:
              log.debug('Dummy publisher publishing: {0}'.format(
                  self.publish.value.popleft()
                  )
              )
              msg = {'load': {'fun_args': [], 'jid': u'20150206163005831312', 'return': True, 'retcode': 0, 'success': True, 'cmd': '_return', 'fun': u'test.ping', 'id': 'silver'}, 'route': {'src': (u'silver_minion', u'jobber50e73ccefd052167c7', 'jid_ret'), 'dst': (u'silver_master_master', None, 'remote_cmd')}}
              log.debug('Dummy publisher faking return with: {0}'.format(msg))
  
              self.lane_stack.value.transmit(msg, self.lane_stack.value.fetchUidByName('manor'))
              self.lane_stack.value.serviceAll()
  
new_contents: # -*- coding: utf-8 -*-
  '''
  The dummy publisher for the Salt Master
  
  Contains functionality to short-circuit a salt-master's
  publish functionality so that instead of publications being
  sent across the wire, they are instead transparently redirected
  to a returner.
  
  Designed for use primarily in load-testing the salt-master
  without the need for a swarm of real minions.
  '''
  
  # pylint: disable=W0232
  
  # Import python libs
  from __future__ import absolute_import
  import logging
  
  # Import salt libs
  import ioflo.base.deeding
  import salt.daemons.flo.worker
  from raet import raeting
  from raet.lane.stacking import LaneStack
  from raet.lane.yarding import RemoteYard
  
  log = logging.getLogger(__name__)
  
  
  class SaltDummyPublisher(ioflo.base.deeding.Deed):
      '''
      A dummy publisher that transparently redirects publications to 
      a translation system to have them mocked up and sent back into a router
      '''
      Ioinits = {
              'opts': '.salt.opts',
              'publish': '.salt.var.publish',
              'lane_stack': '.salt.lane.manor.stack',
              }
  
      def action(self):
          while self.publish.value:
              pub = self.publish.value.popleft()
              log.debug('Dummy publisher publishing: {0}'.format(pub))
              msg = self._fill_tmpl(pub)
              self.lane_stack.value.transmit(msg, self.lane_stack.value.fetchUidByName('manor'))
  
      def _fill_tmpl(self, pub):
          '''
          Takes a template and a job and fills the template with 
          fake return data associated with the job
          '''
          msg = {'load': {
                      'fun_args': [],
                      'jid': pub['return']['pub']['jid'],
                      'return': True,
                      'retcode': 0,
                      'success': True,
                      'cmd': '_return',
                      'fun': u'test.ping',
                      'id': 'silver'
                 },
                 'route': {
                      'src': (u'silver_minion', u'jobber50e73ccefd052167c7', 'jid_ret'),
                      'dst': (u'silver_master_master', None, 'remote_cmd')
                  }
                 }
  
          log.debug('Dummy publisher faking return with: {0}'.format(msg))
          return msg
  
  
subject: Remove servicequeue because ioflo does this