get topology with wrong filter returns 404

Bug #1582141 reported by Ifat Afek
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Vitrage
Fix Released
Medium
dongwenjuan

Bug Description

The following cli returns `Unknown Error (HTTP 404)'
vitrage topology show --filter '{"and": [{"==": {"category": "RESOURCE"}},{"==": {"is_deleted": "False"}}]}' --graph-type tree

This query is erroneous and should be changed to:

vitrage topology show --filter '{"and": [{"==": {"category": "RESOURCE"}},{"==": {"is_deleted": false}}]}' --graph-type tree
(use false with lower case 'f' and no parenthesis, instead of "False") .

Erroneous queries should not result in 404 error. We need to fix it.

Ifat Afek (ifat-afek)
Changed in vitrage:
importance: Undecided → Medium
Changed in vitrage:
assignee: nobody → dongwenjuan (dong-wenjuan)
Revision history for this message
dongwenjuan (dong-wenjuan) wrote :

I fixed the erroneous query: False->false

vitrage topology show --filter '{"and": [{"==": {"category": "RESOURCE"}},{"==": {"is_deleted": "false"}},{"==": {"is_placeholder": false}}]}'
Unknown Error (HTTP 404)

It still returns the HTTP 404.
But it seems that the openstack.cluster root_data is matched the query condition.
I don't know why...

The error log:
2016-05-17 11:47:23.753 10470 DEBUG oslo_messaging._drivers.amqpdriver [-] received message msg_id: 466a65fccb7c491988b6766855893f64 reply to reply_1664bae4ed4247cab2491515607c0f39 __call__ /usr/local/lib/python2.7/dist-packages/oslo_messaging/_drivers/amqpdriver.py:201
2016-05-17 11:47:23.756 10470 DEBUG vitrage.entity_graph.api_handler.entity_graph_api [-] EntityGraphApis get_topology root:None get_topology /opt/stack/vitrage/vitrage/entity_graph/api_handler/entity_graph_api.py:98
2016-05-17 11:47:23.756 10470 DEBUG vitrage.graph.query [-] create_predicate::((item.get('category')== 'RESOURCE') and (item.get('is_deleted')== 'false') and (item.get('is_placeholder')== False)) create_predicate /opt/stack/vitrage/vitrage/graph/query.py:69
2016-05-17 11:47:23.757 10470 INFO vitrage.graph.algo_driver.networkx_algorithm [-] graph_query_vertices: root RESOURCE:openstack.cluster does not match filter {u'and': [{u'==': {u'category': u'RESOURCE'}}, {u'==': {u'is_deleted': u'false'}}, {u'==': {u'is_placeholder': False}}]}
2016-05-17 11:47:23.757 10470 ERROR oslo_messaging.rpc.dispatcher [-] Exception during message handling: 'NoneType' object has no attribute 'output_graph'

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to vitrage (master)

Fix proposed to branch: master
Review: https://review.openstack.org/318482

Changed in vitrage:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on vitrage (master)

Change abandoned by dongwenjuan (<email address hidden>) on branch: master
Review: https://review.openstack.org/318482

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to vitrage (master)

Reviewed: https://review.openstack.org/318482
Committed: https://git.openstack.org/cgit/openstack/vitrage/commit/?id=7cc45dfc8e668afd3ff7205cf86bd64f6f51e723
Submitter: Jenkins
Branch: master

commit 7cc45dfc8e668afd3ff7205cf86bd64f6f51e723
Author: dongwenjuan <email address hidden>
Date: Thu May 19 05:47:01 2016 -0400

    get topology with wrong filter returns 404

    When use `vitrage topology show` with `--filter` para,
    erroneous queries should not result in 404 error.

    Fixes: bug #1582141

    Change-Id: I1189047849f714d8435414cc48098d71837b3ed0
    Signed-off-by: dongwenjuan <email address hidden>

Changed in vitrage:
status: In Progress → Fix Released
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.