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

Conversation

Projects
None yet
2 participants
@mchugh19
Copy link
Contributor

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 some commits Jan 16, 2018

Christian McHugh
Add Zabbix inventory handling to zabbix execution module.
Support Zabbix inventory handling in zabbix_host state.
Christian McHugh
@rallytime
Copy link
Contributor

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

This comment has been minimized.

Copy link
@rallytime

rallytime Jan 22, 2018

Contributor

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

This comment has been minimized.

Copy link
@rallytime

rallytime Jan 22, 2018

Contributor

Same comment here.

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


def hostinventory_get(hostids, **connection_args):

This comment has been minimized.

Copy link
@rallytime

rallytime Jan 22, 2018

Contributor

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):

This comment has been minimized.

Copy link
@rallytime

rallytime Jan 22, 2018

Contributor

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

Christian McHugh
Adjust salt version
Rename module functions
Cleanup minor lint errors
@mchugh19

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Contributor Author

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.

Christian McHugh
@rallytime

This comment has been minimized.

Copy link
Contributor

commented Feb 8, 2018

Christian McHugh added some commits Feb 8, 2018

Christian McHugh
Christian McHugh
@mchugh19

This comment has been minimized.

Copy link
Contributor Author

commented Feb 8, 2018

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

@mchugh19

This comment has been minimized.

Copy link
Contributor Author

commented Feb 8, 2018

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

@mchugh19

This comment has been minimized.

Copy link
Contributor Author

commented Feb 21, 2018

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

@rallytime

This comment has been minimized.

Copy link
Contributor

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

jenkins/PR/salt-pr-linode-cent7-py3 Pull Requests » Salt PR - Linode CentOS 7 - PY3 #2451 — ABORTED
Details
codeclimate 5 issues to fix
Details
default Build finished.
Details
jenkins/PR/salt-pr-linode-ubuntu14-n Pull Requests » Salt PR - Linode Ubuntu14.04 #20097 — FAILURE
Details
jenkins/PR/salt-pr-linode-ubuntu16-py3 Pull Requests » Salt PR - Linode Ubuntu16.04 - PY3 #7012 — FAILURE
Details
jenkins/PR/salt-pr-rs-cent7-n Pull Requests » Salt PR - RS CentOS 7 #16504 — FAILURE
Details
WIP ready for review
Details
jenkins/PR/salt-pr-clone Pull Requests » Salt PR - Clone #22493 — SUCCESS
Details
jenkins/PR/salt-pr-docs-n Pull Requests » Salt PR - Docs #14843 — SUCCESS
Details
jenkins/PR/salt-pr-lint-n Pull Requests » Salt PR - Code Lint #19452 — SUCCESS
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.