mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Fix ioflo master to read in from the correct queue
This commit is contained in:
parent
0e7124acae
commit
18c5ac99c2
@ -83,8 +83,7 @@ class LocalMaster(ioflo.base.deeding.Deed):
|
|||||||
Abstract access to the core salt master api
|
Abstract access to the core salt master api
|
||||||
'''
|
'''
|
||||||
Ioinits = {'opts': '.salt.etc.opts',
|
Ioinits = {'opts': '.salt.etc.opts',
|
||||||
'local_in': '.salt.net.local_in',
|
'rxmsgs': '.raet.udp.stack'}
|
||||||
'local_out': '.salt.net.local_out'}
|
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
ioflo.base.deeding.Deed.__init__(self)
|
ioflo.base.deeding.Deed.__init__(self)
|
||||||
@ -93,19 +92,24 @@ class LocalMaster(ioflo.base.deeding.Deed):
|
|||||||
'''
|
'''
|
||||||
Set up required objects
|
Set up required objects
|
||||||
'''
|
'''
|
||||||
self.remote = salt.daemons.masterapi.LocalFuncs(self.opts.value)
|
self.local = salt.daemons.masterapi.LocalFuncs(self.opts.value)
|
||||||
|
self.remote = salt.daemons.masterapi.RemoteFuncs(self.opts.value)
|
||||||
|
|
||||||
def action(self):
|
def action(self):
|
||||||
'''
|
'''
|
||||||
Perform an action
|
Perform an action
|
||||||
'''
|
'''
|
||||||
if self.local_in.value:
|
while self.rxmsgs.value:
|
||||||
exchange = self.local_in.value.pop()
|
exchange = self.rxmsgs.value.pop(0)
|
||||||
load = exchange.get('load')
|
load = exchange.get('load')
|
||||||
# If the load is invalid, just ignore the request
|
# If the load is invalid, just ignore the request
|
||||||
if not 'cmd' in load:
|
if not 'cmd' in load:
|
||||||
return False
|
return False
|
||||||
if load['cmd'].startswith('__'):
|
if load['cmd'].startswith('__'):
|
||||||
return False
|
return False
|
||||||
exchange['ret'] = getattr(self.local, load['cmd'])(load)
|
if hasattr(self.remote, load['cmd']):
|
||||||
|
exchange['ret'] = getattr(self.remote, load['cmd'])(load)
|
||||||
|
elif hasattr(self.local, load['cmd']):
|
||||||
|
exchange['ret'] = getattr(self.local, load['cmd'])(load)
|
||||||
|
|
||||||
self.local_out.value.append(exchange)
|
self.local_out.value.append(exchange)
|
||||||
|
Loading…
Reference in New Issue
Block a user