Disable fileserver events by default

@jacksontj, this turns off these event by default and you will
need to set this flag in your config in the future
This commit is contained in:
Thomas S Hatch 2013-12-08 22:46:36 -07:00
parent 1be24c30c4
commit fa1c9c4401
4 changed files with 15 additions and 7 deletions

View File

@ -348,6 +348,11 @@
#
# fileserver_limit_traversal: False
#
# The fileserver can fire events off every time the fileserver is updated,
# these are disabled by default, but can be easily turned on by setting this
# flag to True
#fileserver_events: False
#
# Git fileserver backend configuration
# When using the git fileserver backend at least one git remote needs to be
# defined. The user running the salt master will need read access to the repo.

View File

@ -202,8 +202,9 @@ def update():
pass
# if there is a change, fire an event
event = salt.utils.event.MasterEvent(__opts__['sock_dir'])
event.fire_event(data, tagify(['gitfs', 'update'], prefix='fileserver'))
if __opts__.get('fileserver_events', False):
event = salt.utils.event.MasterEvent(__opts__['sock_dir'])
event.fire_event(data, tagify(['gitfs', 'update'], prefix='fileserver'))
try:
salt.fileserver.reap_fileserver_cache_dir(
os.path.join(__opts__['cachedir'], 'gitfs/hash'),

View File

@ -196,8 +196,9 @@ def update():
pass
# if there is a change, fire an event
event = salt.utils.event.MasterEvent(__opts__['sock_dir'])
event.fire_event(data, tagify(['hgfs', 'update'], prefix='fileserver'))
if __opts__.get('fileserver_events', False):
event = salt.utils.event.MasterEvent(__opts__['sock_dir'])
event.fire_event(data, tagify(['hgfs', 'update'], prefix='fileserver'))
try:
salt.fileserver.reap_fileserver_cache_dir(
os.path.join(__opts__['cachedir'], 'hgfs/hash'),

View File

@ -146,9 +146,10 @@ def update():
fp_.write('{file_path}:{mtime}\n'.format(file_path=file_path,
mtime=mtime))
# if there is a change, fire an event
event = salt.utils.event.MasterEvent(__opts__['sock_dir'])
event.fire_event(data, tagify(['roots', 'update'], prefix='fileserver'))
if __opts__.get('fileserver_events', False):
# if there is a change, fire an event
event = salt.utils.event.MasterEvent(__opts__['sock_dir'])
event.fire_event(data, tagify(['roots', 'update'], prefix='fileserver'))
def file_hash(load, fnd):