Browse Source

Merge "Fix host_aggregate to tolerate aggregate.hosts being None"

changes/52/795752/1
Zuul 2 weeks ago
committed by Gerrit Code Review
parent
commit
da1fab6629
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      plugins/modules/host_aggregate.py

+ 2
- 2
plugins/modules/host_aggregate.py View File

@ -126,14 +126,14 @@ def _update_hosts(cloud, aggregate, hosts, purge_hosts):
if hosts is None:
return
hosts_to_add = set(hosts) - set(aggregate.hosts)
hosts_to_add = set(hosts) - set(aggregate.get("hosts", []))
for i in hosts_to_add:
cloud.add_host_to_aggregate(aggregate.id, i)
if not purge_hosts:
return
hosts_to_remove = set(aggregate.hosts) - set(hosts)
hosts_to_remove = set(aggregate.get("hosts", [])) - set(hosts)
for i in hosts_to_remove:
cloud.remove_host_from_aggregate(aggregate.id, i)


Loading…
Cancel
Save