mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Allow the event listener to work with the test sockets. And even for the minion's
This commit is contained in:
parent
de8d29c8e5
commit
b88d901b78
1 changed files with 9 additions and 3 deletions
|
@ -42,18 +42,24 @@ def parse():
|
|||
if v is not None:
|
||||
opts[k] = v
|
||||
|
||||
opts['sock_dir'] = os.path.join(opts['sock_dir'], opts['node'])
|
||||
if 'minion' in options.node:
|
||||
if args:
|
||||
opts['id'] = args[0]
|
||||
return opts
|
||||
|
||||
opts['id'] = options.node
|
||||
|
||||
return opts
|
||||
|
||||
|
||||
def listen(sock_dir, node):
|
||||
def listen(sock_dir, node, id=None):
|
||||
'''
|
||||
Attach to the pub socket and grab messages
|
||||
'''
|
||||
event = salt.utils.event.SaltEvent(
|
||||
node,
|
||||
sock_dir,
|
||||
id=id
|
||||
)
|
||||
print event.puburi
|
||||
while True:
|
||||
|
@ -69,4 +75,4 @@ def listen(sock_dir, node):
|
|||
|
||||
if __name__ == '__main__':
|
||||
opts = parse()
|
||||
listen(opts['sock_dir'], opts['node'])
|
||||
listen(opts['sock_dir'], opts['node'], id=opts.get('id', ''))
|
||||
|
|
Loading…
Add table
Reference in a new issue