felskrone / salt-eventsd

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

TypeError: setup() takes exactly 1 argument (2 given) #1

Closed syphernl closed 10 years ago

syphernl commented 10 years ago

Running the default / included configs (with modified DB credentials) results in errors like this when running in foreground. In background mode they are not shown nor logged.

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 38, in run
    self._store_data()
  File "/usr/local/lib/python2.7/dist-packages/salteventsd/worker.py", line 117, in _store_data
    self._init_backend(event_set['backend'])
  File "/usr/local/lib/python2.7/dist-packages/salteventsd/worker.py", line 45, in _init_backend
    setup_backend.setup(self.name)
TypeError: setup() takes exactly 1 argument (2 given)
felskrone commented 10 years ago

Could you post the default config from your package?

I can not reproduce this with this steps:

aptitude install salt-eventsd
cd /etc/salt/
mv eventsd.example/eventsd.simple .
salt-eventsd fg

Also: Whats your salt-eventsd package version?

Current is 0.5+11 / salt-eventsd_0.5+11_all.deb.

syphernl commented 10 years ago

Hmm, where are you getting the apt package from? ;) I am/was running straight from source (after sudo python setup.py install

felskrone commented 10 years ago

Its in my repository :-)

I have no tried using the python setup.py call directly. I always build a package to install to put in my repository.

For now, you can try building the package after cloning from github like this (you might have to install a few packages to do an successful built.):

cd salt-eventsd
dpkg-buildpackage -b
cd ..

There should be a salt-eventsd_0.5+11_all.deb in the current directory which you can install with

dpkg -i  salt-eventsd_0.5+11_all.deb
syphernl commented 10 years ago

I have created a Debian package (required debhelper) on my Ubuntu 14.04 vagrant box and installed it.

However, I have not done mv eventsd.example/eventsd.simple . but mv eventsd.example/eventsd . since that is the file it is supposed to read right (or that explains the problem ;-))

Then I copied over the eventsd_workers from the doc folder and changed the DB parameters and the same error occurred again.

syphernl commented 10 years ago

I added extra='' to the setup calls and added a log.debug which show its putting in a number there (4, 8 etc).

syphernl commented 10 years ago

Works fine now with the latest version of eventsd!