felskrone / salt-eventsd

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

AttributeError: 'Minion_Return_Worker' object has no attribute 'hostname' #4

Closed syphernl closed 10 years ago

syphernl commented 10 years ago

The default provided worker does not work:

Exception in thread 1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/local/lib/python2.7/dist-packages/salteventsd/worker.py", line 41, in run
    self._store_data()
  File "/usr/local/lib/python2.7/dist-packages/salteventsd/worker.py", line 124, in _store_data
    self._cleanup()
  File "/usr/local/lib/python2.7/dist-packages/salteventsd/worker.py", line 57, in _cleanup
    backend.shutdown()
  File "/etc/salt/eventsd_workers/Minion_Return_Worker.py", line 66, in shutdown
    self.hostname))
AttributeError: 'Minion_Return_Worker' object has no attribute 'hostname'

Credentials have been set globally in the config

syphernl commented 10 years ago

It looks like it needs to refer to self.creds['hostname']. With that it no longer raises any errors, but I'm not sure whether its the cleanest approach.

felskrone commented 10 years ago

@syphernl Nice find! Fixed!

How did you find this? The data is inserted correctly, what was missing was the clean closing of the connection and the log message. Or did that fail in your setup?

The entry is supposed to be the host the data was sent to, so self.creds['hostname'] is just fine.

syphernl commented 10 years ago

The message was visible in the "fg" mode. It was working fine, except for this particular message upon closing of the DB connection.