From d4cf6c48bcf1200c38d8ab21b80710e43b9f385a Mon Sep 17 00:00:00 2001 From: Seth House Date: Mon, 30 Jun 2014 19:00:43 -0600 Subject: [PATCH 1/3] Call factory method on Channel object --- salt/auth/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/auth/__init__.py b/salt/auth/__init__.py index 40b08260f4..0c598ec91f 100644 --- a/salt/auth/__init__.py +++ b/salt/auth/__init__.py @@ -320,7 +320,7 @@ class Resolver(object): tdata = sreq.send('clear', load) return tdata elif self.opts['transport'] == 'raet': - sreq = salt.transport.Channel( + sreq = salt.transport.Channel.factory( self.opts) sreq.route['dst'] = (None, None, 'local_cmd') tdata = sreq.send(load) From 2304fef40e8353e2fb9feaa496e807645ab96afb Mon Sep 17 00:00:00 2001 From: Seth House Date: Mon, 30 Jun 2014 19:01:24 -0600 Subject: [PATCH 2/3] Add src for local route --- salt/auth/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/salt/auth/__init__.py b/salt/auth/__init__.py index 0c598ec91f..a63fe2c850 100644 --- a/salt/auth/__init__.py +++ b/salt/auth/__init__.py @@ -323,6 +323,7 @@ class Resolver(object): sreq = salt.transport.Channel.factory( self.opts) sreq.route['dst'] = (None, None, 'local_cmd') + sreq.route['src'] = (None, sreq.stack.local.name, None) tdata = sreq.send(load) return tdata From d51c12376ff6ef6078ecca2dc65dab9b09057e09 Mon Sep 17 00:00:00 2001 From: Seth House Date: Mon, 30 Jun 2014 19:01:43 -0600 Subject: [PATCH 3/3] Add safe id lookup --- salt/transport/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/salt/transport/__init__.py b/salt/transport/__init__.py index 70b1a31674..d2d526453b 100644 --- a/salt/transport/__init__.py +++ b/salt/transport/__init__.py @@ -60,12 +60,13 @@ class RAETChannel(Channel): ''' Prepare the stack objects ''' + id = self.opts.get('id', 'master') yid = salt.utils.gen_jid() - stackname = self.opts['id'] + yid + stackname = id + yid dirpath = os.path.join(self.opts['cachedir'], 'raet') self.stack = LaneStack( name=stackname, - lanename=self.opts['id'], + lanename=id, yid=yid, basedirpath=dirpath, sockdirpath=self.opts['sock_dir']) @@ -73,10 +74,10 @@ class RAETChannel(Channel): self.router_yard = yarding.RemoteYard( stack=self.stack, yid=0, - lanename=self.opts['id'], + lanename=id, dirpath=self.opts['sock_dir']) self.stack.addRemote(self.router_yard) - src = (self.opts['id'], self.stack.local.name, None) + src = (id, self.stack.local.name, None) dst = ('master', None, 'remote_cmd') self.route = {'src': src, 'dst': dst}