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 state modules for Zabbix templates, actions and valuemaps #47398

Merged
merged 5 commits into from May 8, 2018

Conversation

Projects
None yet
3 participants
@slivik
Copy link
Contributor

commented Apr 30, 2018

What does this PR do?

Adds functions to existing Zabbix module, test and docs related to newly added state modules for Zabbix templates, actions and value maps.

What issues does this PR fix or reference?

None

Tests written?

Yes

Commits signed with GPG?

Yes

slivik added some commits Apr 30, 2018

@cachedout

This comment has been minimized.

Copy link
Collaborator

commented Apr 30, 2018

@jirikotlin Can you look some of this over? I know you've done a lot of work in this area.

'''
.. versionadded:: 2017.7
Imports Zabbix configuration sepcified in file to Zabbix server.

This comment has been minimized.

Copy link
@mchugh19

mchugh19 Apr 30, 2018

Contributor

Spelling: specified

@@ -846,8 +1070,8 @@ def host_create(host, groups, interfaces, **connection_args):
.. code-block:: bash
salt '*' zabbix.host_create technicalname 4
interfaces='{type: 1, main: 1, useip: 1, ip: "192.168.3.1", dns: "", port: 10050}'
visible_name='Host Visible Name' inventory_mode=0 inventory='{"alias": "something"}'
interfaces='{if_type: 1, main: 1, useip: 1, ip_: "192.168.3.1", dns: "", port: 10050}'

This comment has been minimized.

Copy link
@mchugh19

mchugh19 Apr 30, 2018

Contributor

What is the gain from the change in user facing syntax? Does this require updates to the zabbix_host state? This line also clobbers an example of setting inventory information.

This comment has been minimized.

Copy link
@slivik

slivik May 2, 2018

Author Contributor

Sorry, my mistake. Will fix it in next commit.

This comment has been minimized.

Copy link
@mchugh19

mchugh19 May 2, 2018

Contributor

The Zabbix API uses the following for interfaces in host.create:

"interfaces": [
            {
                "type": 1,
                "main": 1,
                "useip": 1,
                "ip": "192.168.3.1",
                "dns": "",
                "port": "10050"
            }
        ]

Why the change to if_type and ip_? This will affect user configurations and existing states, so is the rename necessary?

This comment has been minimized.

Copy link
@slivik

slivik May 2, 2018

Author Contributor

You are right, it was a typo. Please, see my last commit where it is fixed.

slivik added some commits May 2, 2018

fixed pylint and typos
Merge branch 'zabbix_template_state' of https://github.com/slivik/salt into zabbix_template_state
@@ -1466,7 +1689,7 @@ def hostinterface_get(hostids, **connection_args):
return ret


def hostinterface_create(hostid, ip, dns='', main=1, type=1, useip=1, port=None, **connection_args):
def hostinterface_create(hostid, ip_, dns='', main=1, if_type=1, useip=1, port=None, **connection_args):

This comment has been minimized.

Copy link
@mchugh19

mchugh19 May 2, 2018

Contributor

Should this still be ip_ and if_type?

This comment has been minimized.

Copy link
@slivik

slivik May 2, 2018

Author Contributor

Yes, in this case it is correct since Salt coding style (and pylint) says at least three characters for variable name and "type" is reserved Python keyword.

@cachedout cachedout merged commit 3804827 into saltstack:develop May 8, 2018

4 of 10 checks passed

jenkins/PR/salt-pr-linode-cent7-py3 Pull Requests » Salt PR - Linode CentOS 7 - PY3 #4664 — ABORTED
Details
jenkins/PR/salt-pr-rs-cent7-n Pull Requests » Salt PR - RS CentOS 7 #18719 — ABORTED
Details
codeclimate 47 issues to fix
Details
default Build finished.
Details
jenkins/PR/salt-pr-linode-ubuntu14-n Pull Requests » Salt PR - Linode Ubuntu14.04 #22562 — FAILURE
Details
jenkins/PR/salt-pr-linode-ubuntu16-py3 Pull Requests » Salt PR - Linode Ubuntu16.04 - PY3 #9602 — FAILURE
Details
WIP ready for review
Details
jenkins/PR/salt-pr-clone Pull Requests » Salt PR - Clone #24839 — SUCCESS
Details
jenkins/PR/salt-pr-docs-n Pull Requests » Salt PR - Docs #16960 — SUCCESS
Details
jenkins/PR/salt-pr-lint-n Pull Requests » Salt PR - Code Lint #21580 — 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.