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

Add Zabbix inventory support #45458

Merged
merged 9 commits into from Feb 21, 2018
Merged

Conversation

@mchugh19
Copy link
Contributor

@mchugh19 mchugh19 commented Jan 16, 2018

What does this PR do?

Add Zabbix inventory handling to zabbix execution module
Support Zabbix inventory handling in zabbix_host state

Tests written?

No

Commits signed with GPG?

No

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

Christian McHugh added 2 commits Jan 16, 2018
Copy link
Contributor

@rallytime rallytime left a comment

Thanks for this @mchugh19!

I have a couple of small comments.

Can you also write some tests for these new functions?

Retrieve host inventory according to the given parameters.
See: https://www.zabbix.com/documentation/2.4/manual/api/reference/host/object#host_inventory
.. versionadded:: Oxygen
Copy link
Contributor

@rallytime rallytime Jan 22, 2018

This should be updated to Fluorine as we've completed the feature freeze for oxygen already.

NOTE: This function accepts all standard host: keyword argument names for inventory
see: https://www.zabbix.com/documentation/2.4/manual/api/reference/host/object#host_inventory
.. versionadded:: Oxygen
Copy link
Contributor

@rallytime rallytime Jan 22, 2018

Same comment here.

@@ -1058,6 +1058,97 @@ def host_update(hostid, **connection_args):
return ret


def hostinventory_get(hostids, **connection_args):
Copy link
Contributor

@rallytime rallytime Jan 22, 2018

I think host_inventory_get might be a better name here. I think it's easier to read.

return ret


def hostinventory_set(hostid, **connection_args):
Copy link
Contributor

@rallytime rallytime Jan 22, 2018

host_inventory_set on this function is easier to read, IMHO, as well.

Rename module functions
Cleanup minor lint errors
@mchugh19
Copy link
Contributor Author

@mchugh19 mchugh19 commented Jan 23, 2018

I'm having a bit of trouble coming up with the mocking necessary for the _query method. Could anyone guide me, and I'll write up the test cases?

@mchugh19
Copy link
Contributor Author

@mchugh19 mchugh19 commented Feb 4, 2018

Took another crack at it and got unit tests going. Added tests for the existing user_* and the newly added host_inventory_* methods.

@rallytime
Copy link
Contributor

@rallytime rallytime commented Feb 8, 2018

@mchugh19
Copy link
Contributor Author

@mchugh19 mchugh19 commented Feb 8, 2018

Lint output cleaned up. I had an issue running pylint from python2, but just corrected that.

@mchugh19
Copy link
Contributor Author

@mchugh19 mchugh19 commented Feb 8, 2018

The referenced test failures seem unrelated as they had to do with other testing scripts like vmware.

@mchugh19
Copy link
Contributor Author

@mchugh19 mchugh19 commented Feb 21, 2018

I think all requested updates have been made. Is there anything still outstanding?

@rallytime
Copy link
Contributor

@rallytime rallytime commented Feb 21, 2018

@mchugh19 This looks good to me but the tests timed out before I could double check them. I'll keep an eye on this so we can get it in. Thanks!

@rallytime rallytime merged commit fd0482b into saltstack:develop Feb 21, 2018
4 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants