felskrone / salt-eventsd

events-listener daemon for saltstack that writes data into a database
Other
52 stars 12 forks source link

Sub-events raising KeyError: 'fun' #3

Closed syphernl closed 10 years ago

syphernl commented 10 years ago

I am trying to setup highstate logging. The /etc/salt/eventsd file is based on the extended example with this added:

        subs:
           # name of the sub-event
            highstate:
               # the function name, test.ping. saltutil.sync_modules, cmd.run_all, etc.
                fun: state.highstate
                backend: Minion_Event_Worker
                dict_name: data
                fields: [jid, id, retcode, return]
                template: insert into {0} (jid, servername, ret_code, result) values ('{1}', '{2}', '{3}', '{4}') on duplicate key update jid='{1}', ret_code='{3}', result='{4}';
                mysql_tab: highstate

However, when a highstate is being done this results in the following error:

Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/dist-packages/salteventsd/worker.py", line 38, in run
    self._store_data()
  File "/usr/lib/python2.7/dist-packages/salteventsd/worker.py", line 89, in _store_data
    if( self.event_map[event]['subs'][subevent]['fun'].match( entry['data']['fun'] ) ):
KeyError: 'fun'

This is based on the comments in the config file. Am I doing it wrong or ... ?

syphernl commented 10 years ago

FWIW: the data is being added to the particular table just fine.

syphernl commented 10 years ago

Looks like this problem has been resolved in later revisions. I am not getting such errors anymore.