From a078a99fae1841421572e7d405d2e2f1641b80c8 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Mon, 12 Jan 2015 16:56:31 -0600 Subject: [PATCH] Support accounts with more than 100 load balancers --- lib/ansible/modules/cloud/rackspace/rax_clb.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/rackspace/rax_clb.py b/lib/ansible/modules/cloud/rackspace/rax_clb.py index 38baa77b6f..a3deae6f4a 100644 --- a/lib/ansible/modules/cloud/rackspace/rax_clb.py +++ b/lib/ansible/modules/cloud/rackspace/rax_clb.py @@ -152,7 +152,14 @@ def cloud_load_balancer(module, state, name, meta, algorithm, port, protocol, 'typically indicates an invalid region or an ' 'incorrectly capitalized region name.') - for balancer in clb.list(): + balancer_list = clb.list() + while balancer_list: + retrieved = clb.list(marker=balancer_list.pop().id) + balancer_list.extend(retrieved) + if len(retrieved) < 2: + break + + for balancer in balancer_list: if name != balancer.name and name != balancer.id: continue