Ask Your Question

admin context in

asked 2011-08-02 01:42:22 -0500

fred-yang gravatar image


What will be the best way to get amdin context within derived class JasonFilter(host_filter.JsonFilter) in order to perform db.get_all_by_topic(). zone_aware_scheduler._scheduler(...context...) calls into filter_hosts() without passing "context"

Thanks, -Fred

edit retag flag offensive close merge delete

4 answers

Sort by ยป oldest newest most voted

answered 2011-08-03 15:55:30 -0500

fred-yang gravatar image

Got it! Thanks,

edit flag offensive delete link more

answered 2011-08-02 01:55:04 -0500

from nova import context adm_context = context.get_admin_context()

edit flag offensive delete link more

answered 2011-08-02 22:24:02 -0500

fred-yang gravatar image

It works! Thanks,

BTW, any sample application to exercise Openstck API select() or run-instances through JsonFilter() than through existing hard-coded instance-type through ec2 API? Which we can to modify to test inherited host_filter.JsonFilter() for trusted computing pool though I have modified test_host_filter() for unit testing


edit flag offensive delete link more

answered 2011-08-03 13:59:08 -0500

Hi Fred,

There aren't any JsonFilter examples (other than the tests) only because there are no API calls that will permit us to pass in the JSON query string. The plan was for the OS API POST /zones/boot to permit this (it parallels the POST /servers command), but that was put on hold while we prepare for our internal deadline. But, that's where I think it should go so as not to upset the apple cart.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2011-08-02 01:42:22 -0500

Seen: 104 times

Last updated: Aug 03 '11