diff --git a/plugins/modules/zabbix_item.py b/plugins/modules/zabbix_item.py index 871384cbc..8684b5709 100644 --- a/plugins/modules/zabbix_item.py +++ b/plugins/modules/zabbix_item.py @@ -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: diff --git a/plugins/modules/zabbix_itemprototype.py b/plugins/modules/zabbix_itemprototype.py index 5320f5db7..7f5616320 100644 --- a/plugins/modules/zabbix_itemprototype.py +++ b/plugins/modules/zabbix_itemprototype.py @@ -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: