Fix rax_find_loadbalancer issues

* Loadbalancer IDs are not UUIDs
* Ensure found list exists before using it
This commit is contained in:
Matt Martz 2014-11-06 16:41:34 -06:00
parent 200ecbc3e2
commit 047dffdd01

View file

@ -173,9 +173,9 @@ def rax_find_server(module, rax_module, server):
def rax_find_loadbalancer(module, rax_module, loadbalancer):
clb = rax_module.cloud_loadbalancers
try:
UUID(loadbalancer)
found = clb.get(loadbalancer)
except:
found = []
for lb in clb.list():
if loadbalancer == lb.name:
found.append(lb)