Fix use of bare list/dict types in instance_group object

The instance_group object was merged before we had helpers for
dict and list objects of strings. This makes that object use those
for schema safety.

Change-Id: I1f68e43a83f140f7b29b17c0961b267e64e48390
Closes-bug: 1221383
This commit is contained in:
Dan Smith 2013-09-12 13:41:25 -07:00
parent 61bedc9aa0
commit 6bb8a3b0a7

View File

@ -23,7 +23,8 @@ from nova.objects import utils as obj_utils
class InstanceGroup(base.NovaPersistentObject, base.NovaObject):
# Version 1.0: Initial version
# Version 1.1: String attributes updated to support unicode
VERSION = '1.1'
# Version 1.2: Use list/dict helpers for policies, metadetails, members
VERSION = '1.2'
fields = {
'id': int,
@ -34,9 +35,9 @@ class InstanceGroup(base.NovaPersistentObject, base.NovaObject):
'uuid': obj_utils.str_or_none,
'name': obj_utils.str_or_none,
'policies': list,
'metadetails': dict,
'members': list,
'policies': obj_utils.list_of_strings_or_none,
'metadetails': obj_utils.dict_of_strings_or_none,
'members': obj_utils.list_of_strings_or_none,
}
@staticmethod