Merge pull request #18738 from SmithSamuelM/sam_20141204

Fixed bugs in raetlane.py. Added changes to transport
This commit is contained in:
Thomas S Hatch 2014-12-04 16:49:02 -07:00
commit d4ae243b17

View File

@ -66,7 +66,7 @@ from raet.lane.yarding import RemoteYard
# Module globals for default shared LaneStack for a process. # Module globals for default shared LaneStack for a process.
rx_msgs = {} # module global dict of deques one for each receipient of msgs rx_msgs = {} # module global dict of deques one for each receipient of msgs
lane_stack = None # module global that holds raet LaneStack lane_stack = None # module global that holds raet LaneStack
remote_yard = None # module global that holds raet remote_yard = None # module global that holds raet remote Yard
master_estate_name = None # module global of motivating master estate name master_estate_name = None # module global of motivating master estate name
master_yard_name = None # module global of motivating master yard name master_yard_name = None # module global of motivating master yard name
@ -89,7 +89,7 @@ def _setup(opts, ryn='manor'):
''' '''
Setup the LaneStack lane_stack and RemoteYard lane_remote_yard global Setup the LaneStack lane_stack and RemoteYard lane_remote_yard global
''' '''
global lane_stack, lane_remote_yard # pylint: disable=W0602 global lane_stack, remote_yard # pylint: disable=W0602
role = opts.get('id') role = opts.get('id')
if not role: if not role:
@ -119,13 +119,15 @@ def _setup(opts, ryn='manor'):
sockdirpath=opts['sock_dir']) sockdirpath=opts['sock_dir'])
lane_stack.Pk = raeting.packKinds.pack lane_stack.Pk = raeting.packKinds.pack
log.debug("Created new LaneStack and local Yard named {0} at {1}\n"
"".format(lane_stack.name, lane_stack.ha))
remote_yard = RemoteYard(stack=lane_stack, remote_yard = RemoteYard(stack=lane_stack,
name=ryn, name=ryn,
lanename=lanename, lanename=lanename,
dirpath=opts['sock_dir']) dirpath=opts['sock_dir'])
lane_stack.addRemote(remote_yard) lane_stack.addRemote(remote_yard)
log.debug("Created new LaneStack and local Yard named {0} at {1}\n".format( log.debug("Added to LaneStack {0} remote Yard named {1} at {2}\n"
lane_stack.name, lane_stack.ha)) "".format(lane_stack.name, remote_yard.name, remote_yard.ha))
def transmit(msg): def transmit(msg):
@ -138,7 +140,7 @@ def transmit(msg):
def service(): def service():
''' '''
Service the lane_stack and move any received messages into their associated Service the lane_stack and move any received messages into their associated
deques in lane_rx_msgs keyed by the destination share in the msg route dict deques in rx_msgs keyed by the destination share in the msg route dict
''' '''
lane_stack.serviceAll() lane_stack.serviceAll()
while lane_stack.rxMsgs: while lane_stack.rxMsgs: