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

from_json with None crashes event stream #264

Open
nisbus opened this issue Jul 9, 2019 · 0 comments
Open

from_json with None crashes event stream #264

nisbus opened this issue Jul 9, 2019 · 0 comments

Comments

@nisbus
Copy link

nisbus commented Jul 9, 2019

When listening to the event stream for some reason some event is None.
When that happens, from_json crashes the stream subscription.

File "/lib/python3.7/site-packages/marathon/client.py", line 795, in event_stream
    yield ef.process(event_data)
  File "/lib/python3.7/site-packages/marathon/models/events.py", line 215, in process
    return clazz.from_json(event)
  File "/lib/python3.7/site-packages/marathon/models/base.py", line 43, in from_json
    return cls(**{to_snake_case(k): v for k, v in attributes.items()})
  File "/lib/python3.7/site-packages/marathon/models/events.py", line 36, in __init__
    self._set(attribute, kwargs.get(attribute))
  File "/lib/python3.7/site-packages/marathon/models/events.py", line 56, in _set
    attribute = self.__to_marathon_object(attribute_name, attribute)
  File "/lib/python3.7/site-packages/marathon/models/events.py", line 42, in __to_marathon_object
    attribute = clazz.from_json(attribute)
  File "/lib/python3.7/site-packages/marathon/models/base.py", line 43, in from_json
    return cls(**{to_snake_case(k): v for k, v in attributes.items()})
  File "/lib/python3.7/site-packages/marathon/models/deployment.py", line 74, in __init__
    self.original = MarathonDeploymentOriginalState.from_json(original)
  File "/lib/python3.7/site-packages/marathon/models/base.py", line 43, in from_json
    return cls(**{to_snake_case(k): v for k, v in attributes.items()})
AttributeError: 'NoneType' object has no attribute 'items'

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