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

Check detailed data (from getChecks) #26

Open
nferrari opened this issue Jul 30, 2015 · 3 comments
Open

Check detailed data (from getChecks) #26

nferrari opened this issue Jul 30, 2015 · 3 comments

Comments

@nferrari
Copy link

Hi,

It seems accessing some additional data (by additional data, I mean the keys returned by /checks/{checkid} on Pingdom API but not returned by /checks, e.g. sendnotificationwhendown attribute) on a PingdomCheck returned by Pingdom.getChecks() does not return successfully the value we want.

From what I've understood in the source code, the missing detailed keys are set to None, causing the getattr method not to be called then. See https://github.com/KennethWilke/PingdomLib/blob/master/pingdomlib/check.py#L164.

Is there any explanation for this part of the code? Am I missing something?

Thank you.

Regards,

@KennethWilke
Copy link
Owner

Ah, that code was put in place to fix #15 . What's supposed to happen is the collection call to /checks saves any details it gets, if you try to access a field that hasn't been queried it will query /checks/{id} for the full details and abstract that bit of the process from you.

When I get a little more time I'll check into this and see how we can restore the automatic attribute filling without reintroducing the bug that causes hangs for some attributes. Thanks for catching this and filing an issue!

@nferrari
Copy link
Author

Ok then it's indeed a bug caused by this resolution. I think the fields should not be set to None this way (generically) but maybe manage specifically the fields having issues (lasterrortime and contactids according to #15).

Current workaround is to manually call the PingdomCheck.getDetails method.

@jimpriest
Copy link

I'm new to Python - how would I go about calling PingdomCheck.getDetails()??

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

3 participants