Send delete only on active Nexus switches

To prevent exceptions and delay, send delete transactions only
to Nexus switches that are known to be active.

Change-Id: I1b73fb81d6a9b3baa904eca624d946bf7f231fd6
Closes-bug:  #1530961
(cherry picked from commit c694091de7)
This commit is contained in:
Carol Bouchard 2016-01-11 10:08:48 -05:00
parent d6b5c875e0
commit 0ef628405e
2 changed files with 4 additions and 7 deletions

View File

@ -981,7 +981,7 @@ class CiscoNexusMechanismDriver(api.MechanismDriver):
Called during delete postcommit port event.
"""
host_connections = self._get_host_connections(host_id)
host_connections = self._get_active_host_connections(host_id)
# (nexus_port,switch_ip) will be unique in each iteration.
# But switch_ip will repeat if host has >1 connection to same switch.

View File

@ -450,9 +450,6 @@ class TestCiscoNexusReplay(test_cisco_nexus_base.TestCiscoNexusBase):
result_del = (
[test_cisco_nexus_base.RESULT_DEL_INTERFACE.
format('ethernet', '1\/3', 269),
test_cisco_nexus_base.RESULT_DEL_VLAN.format(269),
test_cisco_nexus_base.RESULT_DEL_INTERFACE.
format('ethernet', '1\/2', 269),
test_cisco_nexus_base.RESULT_DEL_VLAN.format(269)])
self._basic_delete_verify_port_vlan('test_replay_dual',
result_del,
@ -558,7 +555,7 @@ class TestCiscoNexusReplay(test_cisco_nexus_base.TestCiscoNexusBase):
# Clean-up the port entry
self._basic_delete_verify_port_vlan('test_replay_unique1',
self.driver_result_unique_del2, nbr_of_bindings=0)
[], nbr_of_bindings=0)
def test_replay_get_nexus_type_failure_two_switches(self):
"""Verifies exception during ncclient get inventory. """
@ -620,7 +617,7 @@ class TestCiscoNexusReplay(test_cisco_nexus_base.TestCiscoNexusBase):
# Clean-up the port entry
self._basic_delete_verify_port_vlan('test_replay_unique1',
self.driver_result_unique_del2)
[])
def test_replay_create_vlan_failure_during_replay(self):
"""Verifies exception during create vlan while replaying. """
@ -855,7 +852,7 @@ class TestCiscoNexusReplay(test_cisco_nexus_base.TestCiscoNexusBase):
# Test 3)
# Verify delete transaction doesn't affect failure stats.
self._basic_delete_verify_port_vlan('test_replay_unique1',
self.driver_result_unique_del2)
[])
# Verify failure stats is not reset
assert(self._cisco_mech_driver.get_switch_replay_failure(