Skip to content

Commit

Permalink
Update host group map when creating host group
Browse files Browse the repository at this point in the history
  • Loading branch information
pederhan committed Aug 15, 2024
1 parent 4daa2c3 commit d69e48d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions zabbix_auto_config/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1823,12 +1823,12 @@ def do_update(self) -> None:
zabbix_hostgroup = zabbix_hostgroups.get(hostgroup_name, None)
if not zabbix_hostgroup:
# The hostgroup doesn't exist. We need to create it.
zabbix_hostgroup_id = self.create_hostgroup(hostgroup_name)
hostgroup_id = self.create_hostgroup(hostgroup_name)
# Add group to mapping so we don't try to create it again
if zabbix_hostgroup_id:
zabbix_hostgroups[hostgroup_name] = self.api.get_hostgroup(
hostgroup_name
)
if hostgroup_id:
zabbix_hostgroup = self.api.get_hostgroup(hostgroup_id)
zabbix_hostgroups[hostgroup_name] = zabbix_hostgroup

if zabbix_hostgroup:
host_hostgroups[hostgroup_name] = zabbix_hostgroup

Expand Down

0 comments on commit d69e48d

Please sign in to comment.