mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
Warn if eventlisten is unable to access socket
This commit is contained in:
parent
ef9494536e
commit
2d98bc16aa
@ -63,6 +63,20 @@ def parse():
|
||||
return opts
|
||||
|
||||
|
||||
def check_access_and_print_warning(sock_dir):
|
||||
'''
|
||||
Check if this user is able to access the socket
|
||||
directory and print a warning if not
|
||||
'''
|
||||
if (os.access(sock_dir, os.R_OK) and
|
||||
os.access(sock_dir, os.W_OK) and
|
||||
os.access(sock_dir, os.X_OK)):
|
||||
return
|
||||
else:
|
||||
print('WARNING: Events will not be reported'
|
||||
' (not able to access {0})'.format(sock_dir))
|
||||
|
||||
|
||||
#def listen(sock_dir, node):
|
||||
def listen(opts):
|
||||
'''
|
||||
@ -72,6 +86,7 @@ def listen(opts):
|
||||
opts['node'],
|
||||
opts['sock_dir']
|
||||
)
|
||||
check_access_and_print_warning(opts['sock_dir'])
|
||||
print(event.puburi)
|
||||
jid_counter = 0
|
||||
found_minions = []
|
||||
|
Loading…
Reference in New Issue
Block a user