Re: [openstack-dev] [Nova] questions on object/db usage

2014-11-05 Thread Daniele Casini

Hi All:

I replaced all*/db.instance_get_all_by_host()/*in nova and tested it 
using *tox*.
Might it be useful? If so, Which is the better way to propose it to 
OpenStack community?


Best regards,

Daniele


On 10/23/2014 09:01 PM, Dan Smith wrote:

When I fix some bugs, I found that some code in
nova/compute/api.py
   sometimes we use db ,sometimes we use objects do we have
any criteria for it? I knew we can't access db in compute layer code,
how about others ? prefer object or db direct access? thanks

Prefer objects, and any remaining db.* usage anywhere (other than the
object code itself) is not only a candidate for cleanup, it's much
appreciated :)

--Dan



___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev



___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Nova] questions on object/db usage

2014-11-05 Thread Chen CH Ji
I also working on it and I am glad you can help this ,see
https://review.openstack.org/#/c/130744/ for some info though it's still
ongoing

if you want to know general rule  ,I guess
https://wiki.openstack.org/wiki/How_To_Contribute can be a good place to
refer

Best Regards!

Kevin (Chen) Ji 纪 晨

Engineer, zVM Development, CSTL
Notes: Chen CH Ji/China/IBM@IBMCN   Internet: jiche...@cn.ibm.com
Phone: +86-10-82454158
Address: 3/F Ring Building, ZhongGuanCun Software Park, Haidian District,
Beijing 100193, PRC



From:   Daniele Casini daniele.cas...@dektech.com.au
To: OpenStack Development Mailing List (not for usage questions)
openstack-dev@lists.openstack.org
Date:   11/05/2014 07:22 PM
Subject:Re: [openstack-dev] [Nova] questions on object/db usage



Hi All:

I replaced all db.instance_get_all_by_host() in nova and tested it using
tox.
Might it be useful? If so, Which is the better way to propose it to
OpenStack community?

Best regards,

Daniele


On 10/23/2014 09:01 PM, Dan Smith wrote:
   When I fix some bugs, I found that some code in
nova/compute/api.py
  sometimes we use db ,sometimes we use objects do
we have
any criteria for it? I knew we can't access db in compute layer
code,
how about others ? prefer object or db direct access? thanks


  Prefer objects, and any remaining db.* usage anywhere (other than the
  object code itself) is not only a candidate for cleanup, it's much
  appreciated :)

  --Dan




  ___
  OpenStack-dev mailing list
  OpenStack-dev@lists.openstack.org
  http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [Nova] questions on object/db usage

2014-10-23 Thread Chen CH Ji

Hi
   When I fix some bugs, I found that some code in
nova/compute/api.py

  sometimes we use db ,sometimes we use objects do we have any
criteria for it? I knew we can't access db in compute layer code, how about
others ? prefer object or db direct access? thanks

def service_delete(self, context, service_id):
Deletes the specified service.
objects.Service.get_by_id(context, service_id).destroy()

def instance_get_all_by_host(self, context, host_name):
Return all instances on the given host.
return self.db.instance_get_all_by_host(context, host_name)

def compute_node_get_all(self, context):
return self.db.compute_node_get_all(context)

Best Regards!

Kevin (Chen) Ji 纪 晨

Engineer, zVM Development, CSTL
Notes: Chen CH Ji/China/IBM@IBMCN   Internet: jiche...@cn.ibm.com
Phone: +86-10-82454158
Address: 3/F Ring Building, ZhongGuanCun Software Park, Haidian District,
Beijing 100193, PRC___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Nova] questions on object/db usage

2014-10-23 Thread Dan Smith
When I fix some bugs, I found that some code in
 nova/compute/api.py
   sometimes we use db ,sometimes we use objects do we have
 any criteria for it? I knew we can't access db in compute layer code,
 how about others ? prefer object or db direct access? thanks

Prefer objects, and any remaining db.* usage anywhere (other than the
object code itself) is not only a candidate for cleanup, it's much
appreciated :)

--Dan



signature.asc
Description: OpenPGP digital signature
___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev