'Update security groups on port.
This method returns a flag which indicates request notification
is required and does not perform notification itself.
It is because another changes for the port may require notification.'

def update_security_group_on_port(self, context, id, port, original_port, updated_port):

    need_notify = False
    port_updates = port['port']
    if ((ext_sg.SECURITYGROUPS in port_updates) and (not helpers.compare_elements(original_port.get(ext_sg.SECURITYGROUPS), port_updates[ext_sg.SECURITYGROUPS]))):
        port_updates[ext_sg.SECURITYGROUPS] = self._get_security_groups_on_port(context, port)
        self._delete_port_security_group_bindings(context, id)
        self._process_port_create_security_group(context, updated_port, port_updates[ext_sg.SECURITYGROUPS])
        need_notify = True
    else:
        updated_port[ext_sg.SECURITYGROUPS] = original_port[ext_sg.SECURITYGROUPS]
    return need_notify
