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

Support Python 3 Base WMI #3036

Merged
merged 1 commit into from
Jan 25, 2019
Merged

Support Python 3 Base WMI #3036

merged 1 commit into from
Jan 25, 2019

Conversation

nmuesch
Copy link
Collaborator

@nmuesch nmuesch commented Jan 25, 2019

What does this PR do?

Supports Python3 for the base classes of the WMI check

The biggest change here is the way the metaclass is defined. In Python3, you can no longer do the metaclass approach and need to put it in the declaration of the class itself. Six provides a way to be compatible with both, so I used that.

PEP that changes this - https://www.python.org/dev/peps/pep-3115/

Also, map was returning the map type, so you couldn't add a map to a list, this casts the map to the underlying type of list.

Motivation

🐍3️⃣

Review checklist

  • PR has a meaningful title or PR has the no-changelog label attached
  • Feature or bugfix has tests
  • Git history is clean
  • If PR impacts documentation, docs team has been notified or an issue has been opened on the documentation repo
  • If PR adds a configuration option, it has been added to the configuration file.

Additional Notes

Anything else we should know when reviewing?

@codecov-io
Copy link

codecov-io commented Jan 25, 2019

Codecov Report

Merging #3036 into master will decrease coverage by 8.77%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #3036      +/-   ##
==========================================
- Coverage   84.23%   75.45%   -8.78%     
==========================================
  Files         666       46     -620     
  Lines       35945     3573   -32372     
  Branches     4266      427    -3839     
==========================================
- Hits        30278     2696   -27582     
+ Misses       4422      768    -3654     
+ Partials     1245      109    -1136

Copy link
Contributor

@gmmeyer gmmeyer left a comment

Choose a reason for hiding this comment

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

looks good to me

@nmuesch nmuesch merged commit d92197d into master Jan 25, 2019
@nmuesch nmuesch deleted the nick/checks_base_wmi3 branch January 25, 2019 22:23
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.

3 participants