felskrone / salt-eventsd

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

AttributeError: 'New_Job_Worker' object has no attribute 'hostname' #13

Closed syphernl closed 10 years ago

syphernl commented 10 years ago

Running salt-eventsd 0.8 results in:

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

I assume the hostname is for the MySQL config. I am using the all config to push the MySQL credentials down to the worker like this:

worker_credentials:

    # this entry will be used by any worker that is not explicitly defined
    all:
        username: salt
        password: xxxxxxxxxx
        hostname: localhost
        database: salt
    # add a worker with its name here, to have it use its own credentials
       #Minion_Sub_Worker:
       #username: <user>
       #password: <password>
       #hostname: <hostname>
       #database: <database>
felskrone commented 10 years ago

Nice catch. Fixed with dea1bd67a782c8e5f9c0a37b915aeba6b7a157ec