Merge "NSX-V3| Fix qos switching profile project name"

This commit is contained in:
Jenkins 2017-01-18 08:37:49 +00:00 committed by Gerrit Code Review
commit ca33b1bfcf

View File

@ -15,7 +15,6 @@
# under the License.
from neutron.api.rpc.callbacks import events as callbacks_events
from neutron import context as n_context
from neutron.objects.qos import policy as qos_policy
from neutron.services.qos import qos_consts
from neutron_lib.api import validators
@ -38,16 +37,16 @@ MAX_BURST_MAX_VALUE = int((2 ** 31 - 1) / 128)
def handle_qos_notification(context, resource_type, policies_list,
event_type):
for policy_obj in policies_list:
handle_qos_policy_notification(policy_obj, event_type)
handle_qos_policy_notification(context, policy_obj, event_type)
def handle_qos_policy_notification(policy_obj, event_type):
def handle_qos_policy_notification(context, policy_obj, event_type):
handler = QosNotificationsHandler()
context = n_context.get_admin_context()
# Reload the policy as admin so we will have a context
if (event_type != callbacks_events.DELETED):
policy = qos_policy.QosPolicy.get_object(context, id=policy_obj.id)
policy = qos_policy.QosPolicy.get_object(context.elevated(),
id=policy_obj.id)
# Check if QoS policy rule was created/deleted/updated
if (event_type == callbacks_events.CREATED):