Merge "Fix iptables rule removal warnings from QoS extension"

This commit is contained in:
Zuul 2018-02-13 23:17:16 +00:00 committed by Gerrit Code Review
commit 455238dab1
2 changed files with 2 additions and 9 deletions

View File

@ -142,16 +142,12 @@ class QosLinuxbridgeAgentDriver(qos.QosLinuxAgentDriver):
def _delete_outgoing_qos_chain_for_port(self, port):
chain_name = self._dscp_chain_name(
const.EGRESS_DIRECTION, port['device'])
chain_rule = self._dscp_rule(
const.EGRESS_DIRECTION, port['device'])
# Iptables chain removal "cascades", and will remove rules in
# other chains that jump to it, like those added above.
if self._qos_chain_is_empty(port, 4):
self.iptables_manager.ipv4['mangle'].remove_chain(chain_name)
self.iptables_manager.ipv4['mangle'].remove_rule('POSTROUTING',
chain_rule)
if self._qos_chain_is_empty(port, 6):
self.iptables_manager.ipv6['mangle'].remove_chain(chain_name)
self.iptables_manager.ipv6['mangle'].remove_rule('POSTROUTING',
chain_rule)
def _set_dscp_mark_rule(self, port, dscp_value):
chain_name = self._dscp_chain_name(

View File

@ -242,9 +242,6 @@ class QosLinuxbridgeAgentDriverTestCase(base.BaseTestCase):
self._dscp_rule_tag(self.port['device'])),
mock.call.remove_chain(
dscp_chain_name),
mock.call.remove_rule(
"POSTROUTING",
self._dscp_postrouting_rule(self.port['device']))
]
with mock.patch.object(
self.qos_driver, "iptables_manager") as iptables_manager: