[Openstack] using objects returned from DB layer

Chris Behrens chris.behrens at RACKSPACE.COM
Thu Dec 15 07:10:59 UTC 2011


I've seen a number of patches lately that have code like this:

instance = db.instance_get(...)
instance_uuid = instance.uuid

instead of:

instance_uuid = instance['uuid']

There's a mix of usage throughout the code, and I know some people are just matching the surrounding code.  But, in a number of cases, I've asked for these to be corrected to the latter, on assumption that the DB layer will be returning dictionaries at some point vs the models.  It also pushes the code towards consistent usage.  But I might be the only Nova Core member looking at this and/or maybe my assumption is wrong.

So, I ask here:  Should Nova Core make an effort to reject patches with the former format?   Or did I miss any DB layer plans where the former format is now preferred?

- Chris









More information about the Openstack mailing list