Re: [openstack-dev] [Nova] Detect changes in object model

2014-01-14 Thread Dan Smith
Hi Dan, are you going to cook a patch to expand the base class? Or we can do that ourselves? Yeah, I'll try to get to that today. --Dan ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org

Re: [openstack-dev] [Nova] Detect changes in object model

2014-01-13 Thread Murray, Paul (HP Cloud Services)
Hi Dan, I was actually thinking of changes to the list itself rather than the objects in the list. To try and be clear, I actually mean the following: ObjectListBase has a field called objects that is typed fields.ListOfObjectsField('NovaObject'). I can see methods for count and index, and I

Re: [openstack-dev] [Nova] Detect changes in object model

2014-01-13 Thread Dan Smith
ObjectListBase has a field called objects that is typed fields.ListOfObjectsField('NovaObject'). I can see methods for count and index, and I guess you are talking about adding a method for are any of your contents changed here. I don't see other list operations (like append, insert, remove,

Re: [openstack-dev] [Nova] Detect changes in object model

2014-01-13 Thread Murray, Paul (HP Cloud Services)
Yes, I agree. Actually, I am trying to infer what the programming model for this is as we go along. Personally I would have been happy with only marking the fields when they are set. Then, if a you want to change a list somehow you would get it and then set it again, e.g.: mylist =

Re: [openstack-dev] [Nova] Detect changes in object model

2014-01-13 Thread Wang, Shane
Hi Dan, are you going to cook a patch to expand the base class? Or we can do that ourselves? For the list, I also agree your dirty assumption. -- Shane -Original Message- From: Dan Smith [mailto:d...@danplanet.com] Sent: Friday, January 10, 2014 10:42 PM To: Wang, Shane; OpenStack

Re: [openstack-dev] [Nova] Detect changes in object model

2014-01-10 Thread Dan Smith
If an object A contains another object or object list (called sub-object), any change happened in the sub-object can't be detected by obj_what_changed() in object A. Well, like the Instance object does, you can override obj_what_changed() to expose that fact to the caller. However, I think

Re: [openstack-dev] [Nova] Detect changes in object model

2014-01-10 Thread Murray, Paul (HP Cloud Services)
Sounds good to me. The list base objects don't have methods to make changes to the list - so it would be a case of iterating looking at each object in the list. That would be ok. Do we need the contents of the lists to be modified without assigning a new list? - that would need a little more

Re: [openstack-dev] [Nova] Detect changes in object model

2014-01-10 Thread Dan Smith
Sounds good to me. The list base objects don't have methods to make changes to the list - so it would be a case of iterating looking at each object in the list. That would be ok. Hmm? You mean for NovaObjects that are lists? I hesitate to expose lists as changed when one of the objects