diff --git a/salt/transport/road/raet/behaving.py b/salt/transport/road/raet/behaving.py index 47b3886cfa..b125def230 100644 --- a/salt/transport/road/raet/behaving.py +++ b/salt/transport/road/raet/behaving.py @@ -117,7 +117,7 @@ class CloserStackUdpRaet(deeding.Deed): # pylint: disable=W0232 Close udp socket ''' if self.stack.value and isinstance(self.stack.value, stacking.StackUdp): - self.stack.value.serverUdp.close() + self.stack.value.server.close() class JoinerStackUdpRaet(deeding.Deed): # pylint: disable=W0232 ''' @@ -312,7 +312,7 @@ class CloserStackUxdRaet(deeding.Deed): # pylint: disable=W0232 Close uxd socket ''' if self.stack.value and isinstance(self.stack.value, stacking.StackUxd): - self.stack.value.serverUxd.close() + self.stack.value.server.close() class AddYardStackUxdRaet(deeding.Deed): # pylint: disable=W0232 ''' diff --git a/salt/transport/road/raet/stacking.py b/salt/transport/road/raet/stacking.py index 1037840876..29c02c2770 100644 --- a/salt/transport/road/raet/stacking.py +++ b/salt/transport/road/raet/stacking.py @@ -91,9 +91,9 @@ class StackUdp(object): main=main, ha=ha) self.estate.stack = self - self.serverUdp = aiding.SocketUdpNb(ha=self.estate.ha, bufsize=raeting.MAX_MESSAGE_SIZE) - self.serverUdp.reopen() # open socket - self.estate.ha = self.serverUdp.ha # update estate host address after open + self.server = aiding.SocketUdpNb(ha=self.estate.ha, bufsize=raeting.MAX_MESSAGE_SIZE) + self.server.reopen() # open socket + self.estate.ha = self.server.ha # update estate host address after open self.dumpLocal() # save local estate data kepts = self.loadAllRemote() # remote estates from saved data @@ -326,17 +326,17 @@ class StackUdp(object): ''' Service the UDP receive and transmit queues ''' - if self.serverUdp: + if self.server: while True: - rx, ra = self.serverUdp.receive() # if no data the duple is ('',None) + rx, ra = self.server.receive() # if no data the duple is ('',None) if not rx: # no received data so break break # triple = ( packet, source address, destination address) - self.udpRxes.append((rx, ra, self.serverUdp.ha)) + self.udpRxes.append((rx, ra, self.server.ha)) while self.udpTxes: tx, ta = self.udpTxes.popleft() # duple = (packet, destination address) - self.serverUdp.send(tx, ta) + self.server.send(tx, ta) return None @@ -351,13 +351,13 @@ class StackUdp(object): UDP Socket send ''' - if self.serverUdp: + if self.server: while True: - rx, ra = self.serverUdp.receive() # if no data the duple is ('',None) + rx, ra = self.server.receive() # if no data the duple is ('',None) if not rx: # no received data so break break # triple = ( packet, source address, destination address) - self.udpRxes.append((rx, ra, self.serverUdp.ha)) + self.udpRxes.append((rx, ra, self.server.ha)) self.serviceUdpRx() @@ -367,7 +367,7 @@ class StackUdp(object): while self.udpTxes: tx, ta = self.udpTxes.popleft() # duple = (packet, destination address) - self.serverUdp.send(tx, ta) + self.server.send(tx, ta) return None @@ -620,9 +620,9 @@ class StackUxd(object): self.uxdTxes = uxdTxes if uxdTxes is not None else deque() # uxd packets to transmit self.lane = lane # or keeping.LaneKeep() self.accept = self.Accept if accept is None else accept #accept uxd msg if not in lane - self.serverUxd = aiding.SocketUxdNb(ha=self.yard.ha, bufsize=raeting.MAX_MESSAGE_SIZE) - self.serverUxd.reopen() # open socket - self.yard.ha = self.serverUxd.ha # update estate host address after open + self.server = aiding.SocketUxdNb(ha=self.yard.ha, bufsize=raeting.MAX_MESSAGE_SIZE) + self.server.reopen() # open socket + self.yard.ha = self.server.ha # update estate host address after open #self.lane.dumpLocalLane(self.yard) @@ -704,17 +704,17 @@ class StackUxd(object): ''' Service the UXD receive and transmit queues ''' - if self.serverUxd: + if self.server: while True: - rx, ra = self.serverUxd.receive() # if no data the duple is ('',None) + rx, ra = self.server.receive() # if no data the duple is ('',None) if not rx: # no received data so break break # triple = ( packet, source address, destination address) - self.uxdRxes.append((rx, ra, self.serverUxd.ha)) + self.uxdRxes.append((rx, ra, self.server.ha)) while self.uxdTxes: tx, ta = self.uxdTxes.popleft() # duple = (packet, destination address) - self.serverUxd.send(tx, ta) + self.server.send(tx, ta) return None @@ -728,13 +728,13 @@ class StackUxd(object): Uxd Socket send ''' - if self.serverUxd: + if self.server: while True: - rx, ra = self.serverUxd.receive() # if no data the duple is ('',None) + rx, ra = self.server.receive() # if no data the duple is ('',None) if not rx: # no received data so break break # triple = ( packet, source address, destination address) - self.uxdRxes.append((rx, ra, self.serverUxd.ha)) + self.uxdRxes.append((rx, ra, self.server.ha)) self.serviceUxdRx() @@ -742,7 +742,7 @@ class StackUxd(object): while self.uxdTxes: tx, ta = self.uxdTxes.popleft() # duple = (packet, destination address) - self.serverUxd.send(tx, ta) + self.server.send(tx, ta) return None diff --git a/salt/transport/road/raet/test/test_keeping.py b/salt/transport/road/raet/test/test_keeping.py index c46c5d5fcf..ffe2d62f84 100644 --- a/salt/transport/road/raet/test/test_keeping.py +++ b/salt/transport/road/raet/test/test_keeping.py @@ -115,8 +115,8 @@ def test(): print stack1.safe.loadLocalData() print stack1.safe.loadAllRemoteData() - stack0.serverUdp.close() - stack1.serverUdp.close() + stack0.server.close() + stack1.server.close() #master stack dirpath = os.path.join(os.getcwd(), 'keep', 'master') diff --git a/salt/transport/road/raet/test/test_stackBootstrap.py b/salt/transport/road/raet/test/test_stackBootstrap.py index 2b9e5647f1..8cb12115c0 100644 --- a/salt/transport/road/raet/test/test_stackBootstrap.py +++ b/salt/transport/road/raet/test/test_stackBootstrap.py @@ -161,9 +161,9 @@ def test(): print stack1.safe.loadAllRemoteData() print - stack0.serverUdp.close() - stack1.serverUdp.close() - stack2.serverUdp.close() + stack0.server.close() + stack1.server.close() + stack2.server.close() #estate0 = stack0.loadLocal() #print estate0.name, estate0.eid, estate0.sid, estate0.ha, estate0.signer, estate0.priver @@ -280,9 +280,9 @@ def test(): print "{0} estates=\n{1}".format(stack2.name, stack2.estates) print "{0} transactions=\n{1}".format(stack2.name, stack2.transactions) - stack0.serverUdp.close() - stack1.serverUdp.close() - stack2.serverUdp.close() + stack0.server.close() + stack1.server.close() + stack2.server.close() stack0.clearLocal() stack0.clearAllRemote() diff --git a/salt/transport/road/raet/test/test_stackBootstrap2.py b/salt/transport/road/raet/test/test_stackBootstrap2.py index 88ad8d90cf..1fb9e5a6e0 100644 --- a/salt/transport/road/raet/test/test_stackBootstrap2.py +++ b/salt/transport/road/raet/test/test_stackBootstrap2.py @@ -117,8 +117,8 @@ def test(preClearMaster=False, preClearMinion=False, postClearMaster=False, post print stack1.safe.loadAllRemoteData() print - stack0.serverUdp.close() - stack1.serverUdp.close() + stack0.server.close() + stack1.server.close() if postClearMaster: keeping.clearAllRoadSafe(masterDirpath) diff --git a/salt/transport/road/raet/test/test_stackUdp.py b/salt/transport/road/raet/test/test_stackUdp.py index 1ca3e81bf8..4ec3b39285 100644 --- a/salt/transport/road/raet/test/test_stackUdp.py +++ b/salt/transport/road/raet/test/test_stackUdp.py @@ -301,8 +301,8 @@ def testStackUdp(bk=raeting.bodyKinds.json): for msg in stack1.rxMsgs: print msg - stack0.serverUdp.close() - stack1.serverUdp.close() + stack0.server.close() + stack1.server.close() stack0.clearLocal() stack0.clearAllRemote() diff --git a/salt/transport/road/raet/test/test_stackUdpBootstrap1.py b/salt/transport/road/raet/test/test_stackUdpBootstrap1.py index d8f0674729..c6aac4bdd0 100644 --- a/salt/transport/road/raet/test/test_stackUdpBootstrap1.py +++ b/salt/transport/road/raet/test/test_stackUdpBootstrap1.py @@ -147,8 +147,8 @@ def test(): print stack1.safe.loadAllRemoteData() print - stack0.serverUdp.close() - stack1.serverUdp.close() + stack0.server.close() + stack1.server.close() #stack0.clearLocal() #stack0.clearAllRemote() diff --git a/salt/transport/road/raet/test/test_stackUxd.py b/salt/transport/road/raet/test/test_stackUxd.py index 0a300f73d2..34133c934c 100644 --- a/salt/transport/road/raet/test/test_stackUxd.py +++ b/salt/transport/road/raet/test/test_stackUxd.py @@ -20,7 +20,7 @@ def testStackUxd(kind=raeting.packKinds.json): ''' - console.reinit(verbosity=console.Wordage.verbose) + console.reinit(verbosity=console.Wordage.concise) stacking.StackUxd.Pk = kind @@ -202,7 +202,8 @@ def testStackUxd(kind=raeting.packKinds.json): print "{0} yards=\n{1}".format(stack1.name, stack1.yards) print "{0} names=\n{1}".format(stack1.name, stack1.names) - + stack0.server.close() + stack1.server.close() if __name__ == "__main__": testStackUxd(raeting.packKinds.json)