Ask Your Question
0

get_members with filter not returning any values

asked 2013-12-03 13:57:55 -0500

bbb gravatar image

updated 2014-01-22 15:12:25 -0500

Evgeny gravatar image

Hey, I was trying to get the members belonging to particular pool in loadpalancer_db by calling this,

get_members(context,{'pool_d':'some_id_received_by'})

and was expecting all the members belonging to that pool. but its not returning anything. Am I missing anything and if I dont specify any filter I receive all the data. I even tried giving some false id and at that time also it did not return anything.

edit retag flag offensive close merge delete

Comments

Please recheck the filter key you are specifying is 'pool_id' and not 'pool_d'. AFAIU, if the filter key you specify is a field/column of the model, filter should work well.

unmesh-gurjar gravatar imageunmesh-gurjar ( 2013-12-04 00:31:41 -0500 )edit

this is the data i get with out any filter { *** 050496-7ea1-4cd9-87c1-644bc3ca7069', 'pool_id': u'c6cc8cea-eefc-4067-8a04-fee89a1e1014' ****} but if have any filter like get_members(context,{'pool_id':u'c6cc8cea-eefc-4067-8a04-fee89a1e1014'} its returns []. Is there any thing i am missing ?

bbb gravatar imagebbb ( 2013-12-04 01:16:00 -0500 )edit

Which version/release of Neutron are you using?

unmesh-gurjar gravatar imageunmesh-gurjar ( 2013-12-04 02:50:19 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-12-04 03:43:13 -0500

unmesh-gurjar gravatar image

Can you try querying as follows: get_members(context,{'pool_id':[u'c6cc8cea-eefc-4067-8a04-fee89a1e1014',]}

edit flag offensive delete link more

Comments

Thanks a lot unmesh ! it worked. Can you please tell me what's the difference? if you dont mind. Or can you guide to the source where I can read on it, as I am quite new to these.

bbb gravatar imagebbb ( 2013-12-04 13:39:38 -0500 )edit

The filters provided are applied from https://github.com/openstack/neutron/blob/master/neutron/db/db_base_plugin_v2.py#L152 (using 'in_'). Which as per SQLAlchemy docs, expects a list of values.

unmesh-gurjar gravatar imageunmesh-gurjar ( 2013-12-05 02:32:02 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2013-12-03 13:57:55 -0500

Seen: 32 times

Last updated: Dec 03 '13