[openstack-dev] Extending nova api core extensions such as os-hosts

Sam Stoelinga sammiestoel at gmail.com
Fri Aug 31 07:36:39 UTC 2012


Hi,

I'm trying to extend the os-hosts extensions by adding some attributes, but
it seems that this is not possible after a lot of debugging.

This is my current approach:
http://pastebin.com/D6mFTE0E

After debugging it seems that it never registers the show function
extension here:
https://github.com/openstack/nova/blob/master/nova/api/openstack/wsgi.py#L714

Should os-hosts first be changed to core feature before it can be extended?
Would it be worth to directly patch contrib/hosts extensions instead of
trying to extend an extension?

Some background:
The company I started working for did many small niche things and hacks
directly to the nova base code, but I recently saw the nova options for
easily extending nearly anything in nova.
Such as osapi_compute_extensions, compute_manager_class, compute_api_class,
compute_driver etc.

So I started working on migrating our changes to extensions where we define
custom compute_api_class etc which uses as its parent the original
nova.compute.api.API.
But hit a wall just now with extending the 'os-hosts' part.

Also wondering is this a good approach to do niche changes in this way? It
seems that this way we can easily merge the folsom release with our niche
changes or at least with less trouble. Because we seperated our niche
changes from the openstack / nova code.

I'm also hoping to supply patches, but I may not be good enough yet and
most changes we did doesn't seem to be ready yet. A small thing I changed
that I think would be usefull for upstream is being able to specicy the
compute_hostapi_class, which is a small patch that adds the flag and uses
the same way to import the api classes as compute_api_class.
Related patch: http://pastebin.com/rWQCwDEW

Many thanks in advance! (Feeling a littly shy mailing many so many experts,
sorry)
Sam Stoelinga
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20120831/e75841ff/attachment.html>


More information about the OpenStack-dev mailing list