Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Lathrop committed May 24, 2024
1 parent 0f9b01e commit c2f314f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions plugins/modules/zabbix_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,12 +426,12 @@ def sanitize_params(self, name, params):
self._module.fail_json(msg="Status must be 'enabled' or 'disabled', got %s" % status)
if 'master_item' in params:
if 'host_name' not in params['master_item']:
params['master_item']['host_name'] = None
params['master_item']['host_name'] = None
if 'template_name' not in params['master_item']:
params['master_item']['template_name'] = None
params['master_item']['template_name'] = None
master_items = self.get_items(params['master_item']['item_name'], params['master_item']['host_name'], params['master_item']['template_name'])
if len(master_items) == 0:
self._module.fail_json(msg="No items with the name %s exist to depend on" % params['master_item']['item_name'])
self._module.fail_json(msg="No items with the name %s exist to depend on" % params['master_item']['item_name'])
params['master_itemid'] = master_items[0]['itemid']
params.pop('master_item')
if 'preprocessing' in params:
Expand Down
9 changes: 5 additions & 4 deletions plugins/modules/zabbix_itemprototype.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,13 @@ def sanitize_params(self, name, discoveryrule_name, params, host_name=None, temp
params.pop('enabled')
if 'master_item' in params:
if 'host_name' not in params['master_item']:
params['master_item']['host_name'] = None
params['master_item']['host_name'] = None
if 'template_name' not in params['master_item']:
params['master_item']['template_name'] = None
master_items = self.get_itemprototypes(params['master_item']['item_name'], params['master_item']['discoveryrule_name'], params['master_item']['host_name'], params['master_item']['template_name'])
params['master_item']['template_name'] = None
master_items = self.get_itemprototypes(params['master_item']['item_name'], params['master_item']['discoveryrule_name'],
params['master_item']['host_name'], params['master_item']['template_name'])
if len(master_items) == 0:
self._module.fail_json(msg="No items with the name %s exist to depend on" % params['master_item']['item_name'])
self._module.fail_json(msg="No items with the name %s exist to depend on" % params['master_item']['item_name'])
params['master_itemid'] = master_items[0]['itemid']
params.pop('master_item')
if 'preprocessing' in params:
Expand Down

0 comments on commit c2f314f

Please sign in to comment.