Zuora-TechOps / ZenossAPIClient

Python API client for Zenoss
Other
4 stars 6 forks source link

KeyError when calling EventsRouter.add_event #20

Open botant opened 4 years ago

botant commented 4 years ago

I get a KeyError when calling EventsRouter.add_event every time the call is made from a new host, project, etc - but just once! After the first call, everything works as expected.

It seems that there is a lag between the two requests made in EventsRouter.add_event. Maybe my Zenoss is configured to do something when it sees a host for the first time, or maybe it is just very slow.

Would it be possible to separate out the send request part from the retrieve event? I thought of the following doing this without breaking the api:

I'm willing to write a PR to help.

Thank you for a great library!

discogestalt commented 4 years ago

Hi @botant - I put up PR #21 to remediate this, give it a look and see if that fixes the issue you're seeing.

thanks!