Objects: Make OPTIONAL_FIELDS a tuple
In some objects this is a list, in some it is a tuple. Just use tuples for consistency. Change-Id: I14871e2abd8680db72ab8e3d9ca873cb608e4039
This commit is contained in:
@@ -246,7 +246,7 @@ class CinderPersistentObject(object):
|
||||
|
||||
This adds the fields that we use in common for all persistent objects.
|
||||
"""
|
||||
OPTIONAL_FIELDS = []
|
||||
OPTIONAL_FIELDS = ()
|
||||
|
||||
Not = db.Not
|
||||
Case = db.Case
|
||||
|
||||
@@ -28,7 +28,7 @@ class CGSnapshot(base.CinderPersistentObject, base.CinderObject,
|
||||
# Version 1.1: Added from_group_snapshot
|
||||
VERSION = '1.1'
|
||||
|
||||
OPTIONAL_FIELDS = ['consistencygroup', 'snapshots']
|
||||
OPTIONAL_FIELDS = ('consistencygroup', 'snapshots')
|
||||
|
||||
# NOTE: When adding a field obj_make_compatible needs to be updated
|
||||
fields = {
|
||||
|
||||
@@ -32,7 +32,7 @@ class Group(base.CinderPersistentObject, base.CinderObject,
|
||||
# Version 1.2: Added replication_status
|
||||
VERSION = '1.2'
|
||||
|
||||
OPTIONAL_FIELDS = ['volumes', 'volume_types', 'group_snapshots']
|
||||
OPTIONAL_FIELDS = ('volumes', 'volume_types', 'group_snapshots')
|
||||
|
||||
# NOTE: When adding a field obj_make_compatible needs to be updated
|
||||
fields = {
|
||||
|
||||
@@ -26,7 +26,7 @@ class GroupSnapshot(base.CinderPersistentObject, base.CinderObject,
|
||||
base.CinderObjectDictCompat, base.ClusteredObject):
|
||||
VERSION = '1.0'
|
||||
|
||||
OPTIONAL_FIELDS = ['group', 'snapshots']
|
||||
OPTIONAL_FIELDS = ('group', 'snapshots')
|
||||
|
||||
# NOTE: When adding a field obj_make_compatible needs to be updated
|
||||
fields = {
|
||||
|
||||
@@ -27,7 +27,7 @@ class GroupType(base.CinderPersistentObject, base.CinderObject,
|
||||
# Version 1.0: Initial version
|
||||
VERSION = '1.0'
|
||||
|
||||
OPTIONAL_FIELDS = ['group_specs', 'projects']
|
||||
OPTIONAL_FIELDS = ('group_specs', 'projects')
|
||||
|
||||
# NOTE: When adding a field obj_make_compatible needs to be updated
|
||||
fields = {
|
||||
|
||||
@@ -33,7 +33,7 @@ class QualityOfServiceSpecs(base.CinderPersistentObject,
|
||||
# 1.0: Initial version
|
||||
VERSION = "1.0"
|
||||
|
||||
OPTIONAL_FIELDS = ['volume_types']
|
||||
OPTIONAL_FIELDS = ('volume_types',)
|
||||
|
||||
# NOTE: When adding a field obj_make_compatible needs to be updated
|
||||
fields = {
|
||||
|
||||
@@ -33,7 +33,7 @@ class VolumeAttachment(base.CinderPersistentObject, base.CinderObject,
|
||||
# Version 1.3: Added the connector attribute.
|
||||
VERSION = '1.3'
|
||||
|
||||
OPTIONAL_FIELDS = ['volume']
|
||||
OPTIONAL_FIELDS = ('volume',)
|
||||
obj_extra_fields = ['project_id', 'volume_host']
|
||||
|
||||
# NOTE: When adding a field obj_make_compatible needs to be updated
|
||||
|
||||
Reference in New Issue
Block a user