Merge "NSX|V3+P: allow removing qos policy from a port"

This commit is contained in:
Zuul 2019-02-20 06:50:32 +00:00 committed by Gerrit Code Review
commit a326982e8a
3 changed files with 11 additions and 1 deletions

View File

@ -684,7 +684,7 @@ class NsxPluginV3Base(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
is_new_compute = updated_compute and not orig_compute
qos_policy_id = None
if validators.is_attr_set(updated_port.get(qos_consts.QOS_POLICY_ID)):
if qos_consts.QOS_POLICY_ID in updated_port:
qos_policy_id = updated_port[qos_consts.QOS_POLICY_ID]
elif original_port:
# Look for the original QoS policy of this port

View File

@ -778,6 +778,11 @@ class NsxPTestPorts(test_db_base_plugin_v2.TestPortsV2,
res = self.plugin.get_port(self.ctx, port['id'])
self.assertEqual(policy_id, res['qos_policy_id'])
# now remove the qos from the port
data['port']['qos_policy_id'] = None
res = self.plugin.update_port(self.ctx, port['id'], data)
self.assertIsNone(res['qos_policy_id'])
def test_create_ext_port_with_qos_fail(self):
with self._create_l3_ext_network() as network:
with self.subnet(network=network, cidr='10.0.0.0/24',

View File

@ -1116,6 +1116,11 @@ class TestPortsV2(test_plugin.TestPortsV2, NsxV3PluginTestCaseMixin,
res = self.plugin.get_port(self.ctx, port['id'])
self.assertEqual(policy_id, res['qos_policy_id'])
# now remove the qos from the port
data['port']['qos_policy_id'] = None
res = self.plugin.update_port(self.ctx, port['id'], data)
self.assertIsNone(res['qos_policy_id'])
def test_create_ext_port_with_qos_fail(self):
with self._create_l3_ext_network() as network:
with self.subnet(network=network, cidr='10.0.0.0/24'),\