summaryrefslogtreecommitdiff
path: root/cinder/message
diff options
context:
space:
mode:
authorTommyLike <tommylikehu@gmail.com>2017-07-04 16:34:42 +0800
committerTommyLike <tommylikehu@gmail.com>2017-07-04 16:34:42 +0800
commit30ac541f8e27b8917dc482f0a41d18b8d8299bcd (patch)
treed182bfc4023fe183b8041539971ce1fd6a48ccd5 /cinder/message
parent22be8149d5094ef4abff922fad401050a7474865 (diff)
downloadcinder-30ac541f8e27b8917dc482f0a41d18b8d8299bcd.tar.gz
Optimize: Replace 'fields.Enum' with 'object'
We don't use any advanced features of 'versionobjects.fields.Enum' in message fields. We can directly use 'object' there. Change-Id: I3e2a7f52c8348ff6b1fb82d849a26c650236e78c
Diffstat (limited to 'cinder/message')
-rw-r--r--cinder/message/message_field.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/cinder/message/message_field.py b/cinder/message/message_field.py
index 8d44fff4b..457614b7c 100644
--- a/cinder/message/message_field.py
+++ b/cinder/message/message_field.py
@@ -19,17 +19,15 @@ Also, use exception-to-detail mapping to decrease the workload of
classifying event in cinder's task code.
"""
-from oslo_versionedobjects import fields
-
from cinder.i18n import _
-class Resource(fields.Enum):
+class Resource(object):
VOLUME = 'VOLUME'
-class Action(fields.Enum):
+class Action(object):
SCHEDULE_ALLOCATE_VOLUME = ('001', _('schedule allocate volume'))
ATTACH_VOLUME = ('002', _('attach volume'))
@@ -42,7 +40,7 @@ class Action(fields.Enum):
UPDATE_ATTACHMENT)
-class Detail(fields.Enum):
+class Detail(object):
UNKNOWN_ERROR = ('001', _('An unknown error occurred.'))
DRIVER_NOT_INITIALIZED = ('002',