mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Fix rax_find_loadbalancer issues
* Loadbalancer IDs are not UUIDs * Ensure found list exists before using it
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user