mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 20:01:25 -07:00
fix legacy PEP8 violations in zabbix modules, remove test exception for them (#31702)
* fix legacy PEP8 violations in zabbix_*, remove test exception for them * fix new pep8 violations for zabbix_maintenance.py
This commit is contained in:
parent
85bd104c7c
commit
1b71fb0499
6 changed files with 14 additions and 21 deletions
|
@ -226,7 +226,6 @@ import copy
|
|||
try:
|
||||
from zabbix_api import ZabbixAPI, ZabbixAPISubClass
|
||||
|
||||
|
||||
# Extend the ZabbixAPI
|
||||
# Since the zabbix-api python module too old (version 1.0, no higher version so far),
|
||||
# it does not support the 'hostinterface' api calls,
|
||||
|
@ -238,7 +237,6 @@ try:
|
|||
ZabbixAPI.__init__(self, server, timeout=timeout, user=user, passwd=passwd, validate_certs=validate_certs)
|
||||
self.hostinterface = ZabbixAPISubClass(self, dict({"prefix": "hostinterface"}, **kwargs))
|
||||
|
||||
|
||||
HAS_ZABBIX_API = True
|
||||
except ImportError:
|
||||
HAS_ZABBIX_API = False
|
||||
|
|
|
@ -172,6 +172,7 @@ class HostMacro(object):
|
|||
except Exception as e:
|
||||
self._module.fail_json(msg="Failed to delete host macro %s: %s" % (macro_name, e))
|
||||
|
||||
|
||||
def main():
|
||||
module = AnsibleModule(
|
||||
argument_spec=dict(
|
||||
|
|
|
@ -380,11 +380,11 @@ def main():
|
|||
module.fail_json(msg="Failed to check maintenance %s existence: %s" % (name, error))
|
||||
|
||||
if maintenance and (
|
||||
sorted(group_ids) != sorted(maintenance["groupids"])
|
||||
or sorted(host_ids) != sorted(maintenance["hostids"])
|
||||
or str(maintenance_type) != maintenance["maintenance_type"]
|
||||
or str(int(start_time)) != maintenance["active_since"]
|
||||
or str(int(start_time + period)) != maintenance["active_till"]
|
||||
sorted(group_ids) != sorted(maintenance["groupids"]) or
|
||||
sorted(host_ids) != sorted(maintenance["hostids"]) or
|
||||
str(maintenance_type) != maintenance["maintenance_type"] or
|
||||
str(int(start_time)) != maintenance["active_since"] or
|
||||
str(int(start_time + period)) != maintenance["active_till"]
|
||||
):
|
||||
if module.check_mode:
|
||||
changed = True
|
||||
|
|
|
@ -8,7 +8,6 @@ from __future__ import absolute_import, division, print_function
|
|||
__metaclass__ = type
|
||||
|
||||
|
||||
|
||||
ANSIBLE_METADATA = {'metadata_version': '1.1',
|
||||
'status': ['preview'],
|
||||
'supported_by': 'community'}
|
||||
|
|
|
@ -171,11 +171,6 @@ lib/ansible/modules/monitoring/sensu_check.py
|
|||
lib/ansible/modules/monitoring/sensu_subscription.py
|
||||
lib/ansible/modules/monitoring/stackdriver.py
|
||||
lib/ansible/modules/monitoring/uptimerobot.py
|
||||
lib/ansible/modules/monitoring/zabbix_group.py
|
||||
lib/ansible/modules/monitoring/zabbix_host.py
|
||||
lib/ansible/modules/monitoring/zabbix_hostmacro.py
|
||||
lib/ansible/modules/monitoring/zabbix_maintenance.py
|
||||
lib/ansible/modules/monitoring/zabbix_screen.py
|
||||
lib/ansible/modules/network/a10/a10_server_axapi3.py
|
||||
lib/ansible/modules/network/a10/a10_virtual_server.py
|
||||
lib/ansible/modules/network/aos/aos_asn_pool.py
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue