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

Mark McLoughlin markmc at redhat.com
Fri Jul 27 05:56:11 UTC 2012


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.

Cheers,
Mark.




More information about the OpenStack-dev mailing list