Adding support for single LaneStack for RaetChannel

This commit is contained in:
Samuel M Smith 2014-07-10 14:14:28 -06:00
parent b5172ed0ac
commit c3b09d3ecc
2 changed files with 11 additions and 2 deletions

View File

@ -18,6 +18,7 @@ from collections import deque
# Import salt libs
import salt.daemons.masterapi
import salt.utils.args
import salt.transport
from raet import raeting, nacling
from raet.road.stacking import RoadStack
from raet.road.estating import LocalEstate
@ -1032,7 +1033,7 @@ class NixExecutor(ioflo.base.deeding.Deed):
salt.utils.daemonize_if(self.opts)
#import wingdbstub
stack = self._setup_jobber_stack()
salt.transport.jobber_stack = stack = self._setup_jobber_stack()
sdata = {'pid': os.getpid()}
sdata.update(data)
@ -1136,3 +1137,4 @@ class NixExecutor(ioflo.base.deeding.Deed):
)
)
stack.server.close()
salt.transport.jobber_stack = None

View File

@ -6,7 +6,7 @@ import time
import os
import threading
from collections import defaultdict
from collections import defaultdict, deque
# Import Salt Libs
import salt.payload
@ -25,6 +25,9 @@ except ImportError:
# Don't die on missing transport libs since only one transport is required
pass
jobber_stack = None # global that holds raet jobber LaneStack
jobber_rxMsgs = {} # dict of deques one for each RaetChannel
class Channel(object):
'''
@ -66,6 +69,10 @@ class RAETChannel(Channel):
'''
Prepare the stack objects
'''
if not jobber_stack:
log.error("Jobber Stack not setup\n")
log.debug("Jobber Stack '{0}' at = {1}\n".format(jobber_stack.local.name,
jobber_stack.local.ha))
mid = self.opts.get('id', 'master')
yid = nacling.uuid(size=18)
stackname = 'raet' + yid