Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabled consumer subclasses crash at startup #483

Open
abompard opened this issue Sep 29, 2017 · 0 comments
Open

Disabled consumer subclasses crash at startup #483

abompard opened this issue Sep 29, 2017 · 0 comments

Comments

@abompard
Copy link
Member

When starting fedmsg-hub I get this in my console:

[    fedmsg    INFO] * disabled by config - fmn.consumer.consumer:FMNConsumer
[moksha.hub   ERROR] Failed to init <class 'fmn.consumer.consumer.FMNConsumer'> consumer.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/moksha/hub/hub.py", line 407, in __init_consumers
    c = c_class(self)
  File "/usr/lib/python2.7/site-packages/fmn/consumer/consumer.py", line 65, in __init__
    self.uri = self.hub.config.get('fmn.sqlalchemy.uri', None)
AttributeError: 'FMNConsumer' object has no attribute 'hub'

I found the reason: on line 105 of the consumers/__init__.py file a check is made to enable the instance or not. If not, the init method is aborted before calling the superclass' constructor method. But it's this superclass' constructor that sets self.hub to the hub provided as argument.
As a result, if the subclass tries to use self.hub later in its constructor, it will crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant