[openstack-dev] [common] moving manager.py and service.py into common

Angus Salkeld asalkeld at redhat.com
Fri Jul 27 06:21:37 UTC 2012


On 27/07/12 06:56 +0100, Mark McLoughlin wrote:
>Hi Angus,
>
>On Fri, 2012-07-27 at 14:19 +1000, Angus Salkeld wrote:
>> Hi
>>
>> If no one else is busy doing $Subject then I'll get busy
>> with it. Both Heat and ceilometer use these (in heat we
>> copied it and ceilometer import it directly).
>>
>> I tried starting ceilometer on Fedora and a receint change
>> to one of them made this impossible. So I thought it's a good
>> time to move them.
>
>Yep, and they're copied into Cinder too. Sounds like a good candidate as
>part of the fight on our lame copying-and-pasting :)
>
>I'd start by thinking about the use cases that are generally
>application.
>
>e.g. looking at manager.py, I see:
>
>  1) loading the DB driver and providing db access via "self.db"
>
>  2) plugin loading
>
>  3) RPC dispatcher
>
>  4) Somewhere to register periodic, recurring jobs
>
>  5) The init_host() hook
>
>  6) Misc bits like 'self.host'
>
>The one to be wary of is the DB stuff, since that requires code which
>isn't already in common.
>
>service.py looks a lot more daunting in terms of making it more general
>- e.g. report_state() is very nova specific.
>
>The way I'd love to see these things done would be for a very basic
>version of this stuff added to common first and then, over time, we pull
>in support for more use cases. Just copying the whole thing piecemeal
>doesn't give us that same opportunity to sit back and think how to make
>it more generally useful so that the likes of glance or keystone can use
>it too.

My plan was pretty much as you suggested:
1) Pull in LoopingCall and cleanup_file_locks().
2) Then manager (minus the version - to be overriden by implemtations)
3) With service.py I was going to try make a simpler one in common and override
    it in nova to provide the db access.

-Angus

>
>Cheers,
>Mark.
>
>
>_______________________________________________
>OpenStack-dev mailing list
>OpenStack-dev at lists.openstack.org
>http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev



More information about the OpenStack-dev mailing list