Listener for Metadef update/delete events throws script error

Bug #1491851 reported by Lakshmi N Sampath
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Searchlight
Fix Released
High
Lakshmi N Sampath

Bug Description

Listener for Metadef update/delete events throws script error.

Start the searchlight listener and try updating an metadef object
glance --os-image-api-version 2 md-object-update OS::Compute::Quota "Disk QoS"

Listener doesn't process the event and throws groovy script error
--------------------------------------------------------------------------------------------------------
2015-09-03 19:09:59.576 4603 ERROR searchlight.elasticsearch.plugins.glance.metadefs_notification_handler [-] TransportError(400, u"ElasticsearchIllegalArgumentException[failed to execute script]; nested: GroovyScriptCompilationException[MultipleCompilationErrorsException[startup failed:\nScript1.groovy: 1: Java-style for-each statement requires a type declaration.;\n solution: Use the 'in' keyword, as for (x in y) {...} @ line 1, column 27.\n obj=null; for(entity_item :ctx._source.objects){if(entity_item['name'].toLowerCase() == entity_id ) obj=entity_item;};if(obj!=null)ctx._source.objects.remove(obj);if (ctx._source.containsKey('objects')){ctx._source.objects += entity_item; }else {ctx._source.objects=entity_list;}\n ^\n\n1 error\n]]; ")
--------------------------------------------------------------------------------------------------------

Changed in searchlight:
assignee: nobody → Lakshmi N Sampath (lakshmi-sampath)
importance: Undecided → High
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to searchlight (master)

Reviewed: https://review.openstack.org/220149
Committed: https://git.openstack.org/cgit/openstack/searchlight/commit/?id=7b05f6c01d08891ebb50c70394d79a6ef1ce2a98
Submitter: Jenkins
Branch: master

commit 7b05f6c01d08891ebb50c70394d79a6ef1ce2a98
Author: Lakshmi N Sampath <email address hidden>
Date: Thu Sep 3 19:24:14 2015 +0530

    Fix for metadef events failing in listener service

    Change-Id: I3347e70dbc63837f139ab5c65693948fbf2b7afd
    Closes-Bug: #1491851

Changed in searchlight:
status: In Progress → Fix Committed
Changed in searchlight:
milestone: none → liberty-rc1
Changed in searchlight:
status: Fix Committed → Fix Released
Changed in searchlight:
milestone: liberty-rc1 → 0.1.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.