diff --git a/shade/openstackcloud.py b/shade/openstackcloud.py index c20bcf05d..8612dec91 100644 --- a/shade/openstackcloud.py +++ b/shade/openstackcloud.py @@ -3557,7 +3557,7 @@ class OpenStackCloud(object): fip_id=floating_ip_id, msg=str(e))) return True - def delete_unattached_floating_ips(self, wait=False, timeout=60): + def delete_unattached_floating_ips(self, retry=1): """Safely delete unattached floating ips. If the cloud can safely purge any unattached floating ips without @@ -3570,8 +3570,10 @@ class OpenStackCloud(object): process is using add_auto_ip from shade, or is creating the floating IPs by passing in a server to the create_floating_ip call. - :param wait: Whether to wait for each IP to be deleted - :param timeout: How long to wait for each IP + :param retry: number of times to retry. Optional, defaults to 1, + which is in addition to the initial delete call. + A value of 0 will also cause no checking of results to + occur. :returns: True if Floating IPs have been deleted, False if not @@ -3582,7 +3584,7 @@ class OpenStackCloud(object): for ip in self.list_floating_ips(): if not ip['attached']: processed.append(self.delete_floating_ip( - id=ip['id'], wait=wait, timeout=timeout)) + floating_ip_id=ip['id'], retry=retry)) return all(processed) if processed else False def _attach_ip_to_server( diff --git a/shade/tests/unit/test_floating_ip_neutron.py b/shade/tests/unit/test_floating_ip_neutron.py index 80dbe9536..8e605496a 100644 --- a/shade/tests/unit/test_floating_ip_neutron.py +++ b/shade/tests/unit/test_floating_ip_neutron.py @@ -565,8 +565,7 @@ class TestFloatingIP(base.TestCase): self.client.delete_unattached_floating_ips() mock_delete_floating_ip.assert_called_once_with( - id="this-is-a-floating-ip-id", - timeout=60, wait=False) + floating_ip_id='this-is-a-floating-ip-id', retry=1) @patch.object(OpenStackCloud, '_submit_create_fip') @patch.object(OpenStackCloud, '_get_free_fixed_port')