[openstack-dev] Context class of openstack common project
Mark McLoughlin
markmc at redhat.com
Wed Jul 18 07:38:20 UTC 2012
Hi,
On Wed, 2012-07-18 at 07:24 +0800, Yong Sheng Gong wrote:
> Hi,
> We ( quantum) are using notifier and rpc code of openstack common
> project, but found these common codes need a common Context class.
> I think the common Context class is from glance project, which is
> using user, and tenant instead of user_id and tenant_id in nova.
> Quantum's Context class is from nova originally.
I see that while the common notifiers code uses this class - and Nova
uses the common notifiers code - Nova itself doesn't use the class. So,
I'm not sure how this is supposed to work.
>
> I think for all others to use the Common code, we have to redesign the
> common Context so that it is easy to be a base class.
I haven't looked too closely, but I suspect you're correct. The Context
class is one of the parts of openstack-common which I think needs more
work for it to be generally useful across projects.
> 1. Don't have fields, such as user, and tenant. Instead we can have
> methods.
> 2. Don't use module methods since it is no way to be redefined.
> Consider factory or define it in configuration.
My one concern is that we may make this class so generic that it
actually contains very little and isn't very useful to have in
openstack-common at all.
Cheers,
Mark.
More information about the OpenStack-dev
mailing list