Skip to content

[wmi] better com_errors handling#2790

Closed
yannmh wants to merge 2 commits intomasterfrom
yann/friendly_com_errors
Closed

[wmi] better com_errors handling#2790
yannmh wants to merge 2 commits intomasterfrom
yann/friendly_com_errors

Conversation

@yannmh
Copy link

@yannmh yannmh commented Aug 25, 2016

[wmi] friendly com_errors 💑

Maintain a list of "known" WMI com_errors, and translate them to user
intelligible errors.
Add a mute parameter to WMISampler.

  • If set to True (default for system checks), com_error are
    "translated" (when possible), logged and do not cause any
    interruption.
  • If not (user checks), "translated" exceptions raise.

[wmi_check][iis] unmute various exceptions 🔊

Unmute WMI com_errors exceptions related to an invalid provider
option or WMI class.

@yannmh yannmh added this to the 5.9.0 milestone Aug 25, 2016
@yannmh
Copy link
Author

yannmh commented Aug 25, 2016

Fix #2671

return set_exception


def raise_on_com_error(error, silent=True):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does silent do? I can't see where we use it...

Copy link
Author

@yannmh yannmh Aug 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops this is a leftover.
Thanks for catching 🍥

@truthbk
Copy link
Member

truthbk commented Aug 26, 2016

Overall beautiful, as always, just have a question for you...

@truthbk
Copy link
Member

truthbk commented Aug 26, 2016

Looks good to me! 👍

@yannmh yannmh force-pushed the yann/friendly_com_errors branch from adcdccd to c557471 Compare August 26, 2016 19:56
@yannmh
Copy link
Author

yannmh commented Aug 26, 2016

Tests are failing on AppVeyor. Need to fix it before merging.

@yannmh yannmh force-pushed the yann/friendly_com_errors branch from c557471 to a314390 Compare August 26, 2016 21:33
@yannmh yannmh force-pushed the yann/friendly_com_errors branch 3 times, most recently from d55d8fb to ad084a7 Compare September 6, 2016 17:07
Yann MAHE added 2 commits September 6, 2016 13:39
Maintain a list of "known" WMI `com_errors`, and translate them to user
intelligible errors.
Add a `mute` parameter to `WMISampler`.
* If set to `True` (default for system checks), `com_error` are
  "translated" (when possible), logged and do not cause any
  interruption.
* If not (user checks), "translated" exceptions raise.
Unmute WMI `com_errors` exceptions related to an invalid `provider`
option or WMI class.
@yannmh yannmh force-pushed the yann/friendly_com_errors branch from ad084a7 to 1437cab Compare September 6, 2016 17:39
@yannmh yannmh removed the bugfix label Sep 6, 2016
@yannmh yannmh modified the milestones: 5.10.0, 5.9.0 Sep 6, 2016
@yannmh
Copy link
Author

yannmh commented Sep 6, 2016

Partially (BUGFIX) merged with #2812.

Other improvements remain open in this PR. The logic need to be improved in order to differentiate errors with the same WMI COM error id.

@olivielpeau olivielpeau modified the milestones: 5.11.0, 5.10.0 Oct 24, 2016
@masci masci modified the milestones: 5.11.0, 5.12.0 Jan 24, 2017
@masci masci removed this from the 5.11.0 milestone Jan 24, 2017
@truthbk
Copy link
Member

truthbk commented Feb 2, 2017

Hi @yannmh,

Thanks again for your contribution, always very much appreciated. We're currently transitioning our checks to a new SDK-based model for the agent. An unfortunate side-effect is that we have to impose a freeze on the dd-agent repo. The SDK consists of two repositories https://github.com/DataDog/integrations-core and https://github.com/DataDog/integrations-extras, where all of our checks will reside. This PR would belong in the core repository. Would you be so kind as to re-open the PR there? We have facilitated some tools to help you with the SDK development that should help you get up and running in no time:

Also, in your case, you also have an agent core component in the PR, so please feel free to open a new PR just with the changes relevant to the core.

We are very sorry for the inconvenience caused.

Thank you for your patience as we make this transition!

@truthbk truthbk closed this Feb 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants