os_nova_host_aggregate - Fix aggregate delete with hosts (#53166)
Aggregate delete task will fail in case it has hosts within the aggregate. As by the OpenStack, the hosts should be removed from the aggregate prior aggregate delete. Add remove host in case provided.
This commit is contained in:
parent
46c44a4359
commit
45ee165fcd
1 changed files with 3 additions and 0 deletions
|
@ -167,6 +167,9 @@ def main():
|
|||
if aggregate is None:
|
||||
changed = False
|
||||
else:
|
||||
if hosts:
|
||||
for h in hosts:
|
||||
cloud.remove_host_from_aggregate(aggregate.id, h)
|
||||
cloud.delete_aggregate(aggregate.id)
|
||||
changed = True
|
||||
module.exit_json(changed=changed)
|
||||
|
|
Loading…
Reference in a new issue