mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-23 19:01:26 -07:00
Fix rax_find_loadbalancer issues
* Loadbalancer IDs are not UUIDs * Ensure found list exists before using it
This commit is contained in:
parent
200ecbc3e2
commit
047dffdd01
1 changed files with 1 additions and 1 deletions
|
@ -173,9 +173,9 @@ def rax_find_server(module, rax_module, server):
|
||||||
def rax_find_loadbalancer(module, rax_module, loadbalancer):
|
def rax_find_loadbalancer(module, rax_module, loadbalancer):
|
||||||
clb = rax_module.cloud_loadbalancers
|
clb = rax_module.cloud_loadbalancers
|
||||||
try:
|
try:
|
||||||
UUID(loadbalancer)
|
|
||||||
found = clb.get(loadbalancer)
|
found = clb.get(loadbalancer)
|
||||||
except:
|
except:
|
||||||
|
found = []
|
||||||
for lb in clb.list():
|
for lb in clb.list():
|
||||||
if loadbalancer == lb.name:
|
if loadbalancer == lb.name:
|
||||||
found.append(lb)
|
found.append(lb)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue