Browse Source

Assume interface detach called for port not found

If the interface has been detached before we call
detach_interface, then we keep on calling it as we
get a 404 from nova. Let's assume it's being called
and check if the interface has been detached.

Task: 42195

Change-Id: I768eeb10c2c24a0c93749b11636ef3e003ecfcd9
changes/88/784388/2
ramishra 2 weeks ago
parent
commit
6ff0dc2e19
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      heat/engine/clients/os/nova.py
  2. +1
    -1
      heat/tests/openstack/nova/test_server.py

+ 1
- 1
heat/engine/clients/os/nova.py View File

@ -788,7 +788,7 @@ echo -e '%s\tALL=(ALL)\tNOPASSWD: ALL' >> /etc/sudoers
server = self.fetch_server(server_id)
if server:
server.interface_detach(port_id)
return True
return True
def interface_attach(self, server_id, port_id=None, net_id=None, fip=None,
security_groups=None):


+ 1
- 1
heat/tests/openstack/nova/test_server.py View File

@ -5165,7 +5165,7 @@ class ServerInternalPortTest(ServersTest):
server.client().servers.get.return_value = nova_server
server.prepare_for_replace()
check_detach.assert_not_called()
self.assertEqual(3, check_detach.call_count)
self.assertEqual(0, self.port_delete.call_count)
def test_prepare_ports_for_replace_error_state(self):


Loading…
Cancel
Save