From e3f7db17cc78757ce3a8bb69e22fc42b302242b3 Mon Sep 17 00:00:00 2001 From: rallytime Date: Fri, 21 Aug 2015 17:50:38 -0600 Subject: [PATCH] Avoid race condition when assigning floating IPs to new VMs Fixes #12225 --- salt/cloud/clouds/openstack.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/salt/cloud/clouds/openstack.py b/salt/cloud/clouds/openstack.py index 1f1d892cc7..49c3e51f5b 100644 --- a/salt/cloud/clouds/openstack.py +++ b/salt/cloud/clouds/openstack.py @@ -6,7 +6,7 @@ OpenStack Cloud Module OpenStack is an open source project that is in use by a number a cloud providers, each of which have their own ways of using it. -:depends: libcloud >- 0.13.2 +:depends: libcloud >= 0.13.2 OpenStack provides a number of ways to authenticate. This module uses password- based authentication, using auth v2.0. It is likely to start supporting other @@ -784,7 +784,7 @@ def _assign_floating_ips(vm_, conn, kwargs): pool = OpenStack_1_1_FloatingIpPool( net['floating'], conn.connection ) - for idx in pool.list_floating_ips(): + for idx in [pool.create_floating_ip()]: if idx.node_id is None: floating.append(idx) if not floating: @@ -808,7 +808,7 @@ def _assign_floating_ips(vm_, conn, kwargs): pool = OpenStack_1_1_FloatingIpPool( '', conn.connection ) - for idx in pool.list_floating_ips(): + for idx in [pool.create_floating_ip()]: if idx.node_id is None: floating.append(idx) if not floating: