[openstack-dev] [Nova] Need help with a gnarly Object Version issue
Day, Phil
philip.day at hp.com
Wed Jun 4 19:28:43 UTC 2014
Hi Folks,
I've been working on a change to make the user_data field an optional part of the Instance object since passing it around everywhere seems a bad idea since:
- It can be huge
- It's only used when getting metadata
- It can contain user sensitive data
-
https://review.openstack.org/#/c/92623/9
I've included the object version changes, and that all works fine - but I'm left with one issue that I'm not sure how to proceed with:
On a compute manager that is still running the old version of the code (i.e using the previous object version), if a method that hasn't yet been converted to objects gets a dict created from the new version of the object (e.g. rescue, get_console_output), then object_compat() decorator will call the _from_db_object() method in objects.Instance. Because this is the old version of the object code, it expects user_data to be a field in dict, and throws a key error.
I can think of a number of possible fixes - but I'm not sure any of them are very elegant (and of course they have to fix the problem before the data is sent to the compute manager):
1) Rather than removing the user_data field from the object just set it to a null value if its not requested.
2) Add object versioning in the client side of the RPC layer for those methods that don't take objects.
I'm open to other ideas, and general guidance around how deletion of fields from Objects is meant to be handled ?
Phil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140604/ebd2218a/attachment.html>
More information about the OpenStack-dev
mailing list