]> xenbits.xensource.com Git - osstest/openstack-nova.git/commitdiff
Pre-add instance actions to avoid merge conflicts
authorBalazs Gibizer <balazs.gibizer@ericsson.com>
Fri, 14 Oct 2016 14:52:17 +0000 (16:52 +0200)
committerstewie925 <st6218@att.com>
Thu, 20 Oct 2016 14:43:14 +0000 (07:43 -0700)
NotificationAction enum values for instance actions are added in a
single commit to avoid merge conflicts when it is added one by one
during the notification transformation.

Also the notification samples added as comments for the same reason.

Change-Id: Idfe41af8718bf5e81ea1608f4c6d00d7cf60cd13
Implements: bp versioned-notification-transformation-ocata

nova/notifications/objects/base.py
nova/notifications/objects/instance.py
nova/objects/fields.py
nova/tests/unit/notifications/objects/test_notification.py

index e2ffa724dc2a57a8cd060b5d424c11022334f81d..ceaddd074c5508a4818eaf5fef23ee58e7749aab 100644 (file)
@@ -39,7 +39,9 @@ class EventType(NotificationObject):
     #              NotificationActionField enum
     # Version 1.2: DELETE value is added to the NotificationActionField enum
     # Version 1.3: Set of new values are added to NotificationActionField enum
-    VERSION = '1.3'
+    # Version 1.4: Another set of new values are added to
+    #              NotificationActionField enum
+    VERSION = '1.4'
 
     fields = {
         'object': fields.StringField(nullable=False),
index b445bdc45394d2b1f02901e1aeb4025b914cff33..bd738144c47b806ffdf24e68c73054aae707ceff 100644 (file)
@@ -271,6 +271,39 @@ class InstanceStateUpdatePayload(base.NotificationPayloadBase):
 # @base.notification_sample('instance-resume-end.json')
 @base.notification_sample('instance-restore-start.json')
 @base.notification_sample('instance-restore-end.json')
+# @base.notification_sample('instance-evacuate.json')
+# @base.notification_sample('instance-resize_finish-start.json')
+# @base.notification_sample('instance-resize_finish-end.json')
+# @base.notification_sample('instance-live_migration_pre-start.json')
+# @base.notification_sample('instance-live_migration_pre-end.json')
+# @base.notification_sample('instance-live_migration_abort-start.json')
+# @base.notification_sample('instance-live_migration_abort-end.json')
+# @base.notification_sample('instance-live_migration_post-start.json')
+# @base.notification_sample('instance-live_migration_post-end.json')
+# @base.notification_sample('instance-live_migration_post_dest-start.json')
+# @base.notification_sample('instance-live_migration_post_dest-end.json')
+# @base.notification_sample('instance-live_migration_rollback-start.json')
+# @base.notification_sample('instance-live_migration_rollback-end.json')
+# @base.notification_sample('instance-live_migration_rollback_dest-start.json')
+# @base.notification_sample('instance-live_migration_rollback_dest-end.json')
+# @base.notification_sample('instance-rebuild-error.json')
+# @base.notification_sample('instance-remove_fixed_ip-start.json')
+# @base.notification_sample('instance-remove_fixed_ip-end.json')
+# @base.notification_sample('instance-resize_confirm-start.json')
+# @base.notification_sample('instance-resize_confirm-end.json')
+# @base.notification_sample('instance-resize_prep-start.json')
+# @base.notification_sample('instance-resize_revert-start.json')
+# @base.notification_sample('instance-resize_revert-end.json')
+# @base.notification_sample('instance-shelve_offload-start.json')
+# @base.notification_sample('instance-shelve_offload-end.json')
+# @base.notification_sample('instance-soft_delete-start.json')
+# @base.notification_sample('instance-soft_delete-end.json')
+# @base.notification_sample('instance-trigger_crash_dump-start.json')
+# @base.notification_sample('instance-trigger_crash_dump-end.json')
+# @base.notification_sample('instance-unrescue-start.json')
+# @base.notification_sample('instance-unrescue-end.json')
+# @base.notification_sample('instance-unshelve-start.json')
+# @base.notification_sample('instance-unshelve-end.json')
 @nova_base.NovaObjectRegistry.register_notification
 class InstanceActionNotification(base.NotificationBase):
     # Version 1.0: Initial version
index 7673b2ef5214fd679b538c47c2cfa82be1fce0a2..9229a54f04e2a17b7a322355a35a89d6d1a61fc4 100644 (file)
@@ -516,10 +516,39 @@ class NotificationAction(BaseNovaEnum):
     SHELVE = 'shelve'
     RESUME = 'resume'
     RESTORE = 'restore'
+    EXISTS = 'exists'
+    RESCUE = 'rescue'
+    VOLUME_ATTACH = 'volume_attach'
+    VOLUME_DETACH = 'volume_detach'
+    CREATE = 'create'
+    EVACUATE = 'evacuate'
+    RESIZE_FINISH = 'resize_finish'
+    LIVE_MIGRATION_ABORT = 'live_migration_abort'
+    LIVE_MIGRATION_POST_DEST = 'live_migration_post_dest'
+    LIVE_MIGRATION_POST = 'live_migration_post'
+    LIVE_MIGRATION_PRE = 'live_migration_pre'
+    LIVE_MIGRATION_ROLLBACK_DEST = 'live_migration_rollback_dest'
+    LIVE_MIGRATION_ROLLBACK = 'live_migration_rollback'
+    REBUILD = 'rebuild'
+    REMOVE_FIXED_IP = 'remove_fixed_ip'
+    RESIZE_CONFIRM = 'resize_confirm'
+    RESIZE_PREP = 'resize_prep'
+    RESIZE_REVERT = 'resize_revert'
+    SHELVE_OFFLOAD = 'shelve_offload'
+    SOFT_DELETE = 'soft_delete'
+    TRIGGER_CRASH_DUMP = 'trigger_crash_dump'
+    UNRESCUE = 'unrescue'
+    UNSHELVE = 'unshelve'
 
     ALL = (UPDATE, EXCEPTION, DELETE, PAUSE, UNPAUSE, RESIZE, VOLUME_SWAP,
            SUSPEND, POWER_ON, REBOOT, SHUTDOWN, SNAPSHOT, ADD_FIXED_IP,
-           POWER_OFF, SHELVE, RESUME, RESTORE)
+           POWER_OFF, SHELVE, RESUME, RESTORE, EXISTS, RESCUE, VOLUME_ATTACH,
+           VOLUME_DETACH, CREATE, EVACUATE, RESIZE_FINISH,
+           LIVE_MIGRATION_ABORT, LIVE_MIGRATION_POST_DEST, LIVE_MIGRATION_POST,
+           LIVE_MIGRATION_PRE, LIVE_MIGRATION_ROLLBACK,
+           LIVE_MIGRATION_ROLLBACK_DEST, REBUILD, REMOVE_FIXED_IP,
+           RESIZE_CONFIRM, RESIZE_PREP, RESIZE_REVERT, SHELVE_OFFLOAD,
+           SOFT_DELETE, TRIGGER_CRASH_DUMP, UNRESCUE, UNSHELVE)
 
 
 # TODO(rlrossit): These should be changed over to be a StateMachine enum from
index 6f4c8732ae95c4ccb759877efaeb3dd54dc8a26e..753bac4bf6ac02023d9e07cd3af028d72a36a647 100644 (file)
@@ -259,7 +259,7 @@ class TestNotificationBase(test.NoDBTestCase):
 notification_object_data = {
     'AuditPeriodPayload': '1.0-28345f72ca9d805eeb61b2c2385805dd',
     'BandwidthPayload': '1.0-49278639296f9939ff2c8947b2078a82',
-    'EventType': '1.3-6ef678bfe9a4ebfd669c96d2d2c124a5',
+    'EventType': '1.4-da0f0fbcda143ca96c2ac1b93937c22c',
     'ExceptionNotification': '1.0-a73147b93b520ff0061865849d3dfa56',
     'ExceptionPayload': '1.0-4516ae282a55fe2fd5c754967ee6248b',
     'FlavorPayload': '1.0-8ad962ab0bafc7270f474c7dda0b7c20',