Notifications Changes Multiple Global Efficacy

This patch adds notfication changes after changing the type
of global_efficacy in ActionPlan objects.

Change-Id: I1116cf1d19e4b19e19789f943a631d0400871766
Partially-Implements: blueprint multiple-global-efficacy-indicator
This commit is contained in:
aditi 2017-11-13 19:22:23 +09:00 committed by aditi
parent e9b7f067c5
commit e41a90d7ad
18 changed files with 69 additions and 62 deletions

View File

@ -20,7 +20,7 @@
"watcher_object.name": "TerseActionPlanPayload",
"watcher_object.data": {
"uuid": "76be87bd-3422-43f9-93a0-e85a577e3061",
"global_efficacy": {},
"global_efficacy": [],
"created_at": "2016-10-18T09:52:05Z",
"updated_at": null,
"state": "CANCELLING",

View File

@ -30,7 +30,7 @@
"watcher_object.name": "TerseActionPlanPayload",
"watcher_object.data": {
"uuid": "76be87bd-3422-43f9-93a0-e85a577e3061",
"global_efficacy": {},
"global_efficacy": [],
"created_at": "2016-10-18T09:52:05Z",
"updated_at": null,
"state": "CANCELLING",

View File

@ -20,7 +20,7 @@
"watcher_object.name": "TerseActionPlanPayload",
"watcher_object.data": {
"uuid": "76be87bd-3422-43f9-93a0-e85a577e3061",
"global_efficacy": {},
"global_efficacy": [],
"created_at": "2016-10-18T09:52:05Z",
"updated_at": null,
"state": "CANCELLING",

View File

@ -20,7 +20,7 @@
"watcher_object.name": "TerseActionPlanPayload",
"watcher_object.data": {
"uuid": "76be87bd-3422-43f9-93a0-e85a577e3061",
"global_efficacy": {},
"global_efficacy": [],
"created_at": "2016-10-18T09:52:05Z",
"updated_at": null,
"state": "ONGOING",

View File

@ -30,7 +30,7 @@
"watcher_object.name": "TerseActionPlanPayload",
"watcher_object.data": {
"uuid": "76be87bd-3422-43f9-93a0-e85a577e3061",
"global_efficacy": {},
"global_efficacy":[],
"created_at": "2016-10-18T09:52:05Z",
"updated_at": null,
"state": "ONGOING",

View File

@ -20,7 +20,7 @@
"watcher_object.name": "TerseActionPlanPayload",
"watcher_object.data": {
"uuid": "76be87bd-3422-43f9-93a0-e85a577e3061",
"global_efficacy": {},
"global_efficacy": [],
"created_at": "2016-10-18T09:52:05Z",
"updated_at": null,
"state": "ONGOING",

View File

@ -29,7 +29,7 @@
"uuid": "76be87bd-3422-43f9-93a0-e85a577e3061",
"fault": null,
"state": "CANCELLED",
"global_efficacy": {},
"global_efficacy": [],
"strategy_uuid": "cb3d0b58-4415-4d90-b75b-1e96878730e3",
"strategy": {
"watcher_object.namespace": "watcher",

View File

@ -57,7 +57,7 @@
"state": "SUCCEEDED"
}
},
"global_efficacy": {},
"global_efficacy": [],
"state": "CANCELLING"
}
},

View File

@ -29,7 +29,7 @@
"uuid": "76be87bd-3422-43f9-93a0-e85a577e3061",
"fault": null,
"state": "CANCELLING",
"global_efficacy": {},
"global_efficacy": [],
"strategy_uuid": "cb3d0b58-4415-4d90-b75b-1e96878730e3",
"strategy": {
"watcher_object.namespace": "watcher",

View File

@ -30,7 +30,7 @@
"uuid": "76be87bd-3422-43f9-93a0-e85a577e3061",
"fault": null,
"state": "ONGOING",
"global_efficacy": {},
"global_efficacy": [],
"strategy_uuid": "cb3d0b58-4415-4d90-b75b-1e96878730e3",
"strategy": {
"watcher_object.namespace": "watcher",

View File

@ -58,7 +58,7 @@
"state": "PENDING"
}
},
"global_efficacy": {},
"global_efficacy": [],
"state": "ONGOING"
}
},

View File

@ -30,7 +30,7 @@
"uuid": "76be87bd-3422-43f9-93a0-e85a577e3061",
"fault": null,
"state": "ONGOING",
"global_efficacy": {},
"global_efficacy": [],
"strategy_uuid": "cb3d0b58-4415-4d90-b75b-1e96878730e3",
"strategy": {
"watcher_object.namespace": "watcher",

View File

@ -75,7 +75,7 @@ table(action_plans) {
foreign_key("strategy_id : Integer")
uuid : String[36]
state : String[20], nullable
global_efficacy : JSONEncodedDict, nullable
global_efficacy : JSONEncodedList, nullable
created_at : DateTime
updated_at : DateTime

View File

@ -45,12 +45,13 @@ class TerseActionPlanPayload(notificationbase.NotificationPayloadBase):
}
# Version 1.0: Initial version
VERSION = '1.0'
# Version 1.1: Changed 'global_efficacy' type Dictionary to List
VERSION = '1.1'
fields = {
'uuid': wfields.UUIDField(),
'state': wfields.StringField(),
'global_efficacy': wfields.FlexibleDictField(nullable=True),
'global_efficacy': wfields.FlexibleListOfDictField(nullable=True),
'audit_uuid': wfields.UUIDField(),
'strategy_uuid': wfields.UUIDField(nullable=True),
@ -80,7 +81,8 @@ class ActionPlanPayload(TerseActionPlanPayload):
}
# Version 1.0: Initial version
VERSION = '1.0'
# Vesrsion 1.1: changed global_efficacy type
VERSION = '1.1'
fields = {
'audit': wfields.ObjectField('TerseAuditPayload'),
@ -112,7 +114,8 @@ class ActionPlanStateUpdatePayload(notificationbase.NotificationPayloadBase):
@base.WatcherObjectRegistry.register_notification
class ActionPlanCreatePayload(ActionPlanPayload):
# Version 1.0: Initial version
VERSION = '1.0'
# Version 1.1: Changed global_efficacy_type
VERSION = '1.1'
fields = {}
def __init__(self, action_plan, audit, strategy):
@ -125,7 +128,8 @@ class ActionPlanCreatePayload(ActionPlanPayload):
@base.WatcherObjectRegistry.register_notification
class ActionPlanUpdatePayload(ActionPlanPayload):
# Version 1.0: Initial version
VERSION = '1.0'
# Version 1.1: Changed global_efficacy_type
VERSION = '1.1'
fields = {
'state_update': wfields.ObjectField('ActionPlanStateUpdatePayload'),
}
@ -141,7 +145,8 @@ class ActionPlanUpdatePayload(ActionPlanPayload):
@base.WatcherObjectRegistry.register_notification
class ActionPlanActionPayload(ActionPlanPayload):
# Version 1.0: Initial version
VERSION = '1.0'
# Version 1.1: Changed global_efficacy_type
VERSION = '1.1'
fields = {
'fault': wfields.ObjectField('ExceptionPayload', nullable=True),
}
@ -157,7 +162,8 @@ class ActionPlanActionPayload(ActionPlanPayload):
@base.WatcherObjectRegistry.register_notification
class ActionPlanDeletePayload(ActionPlanPayload):
# Version 1.0: Initial version
VERSION = '1.0'
# Version 1.1: Changed global_efficacy_type
VERSION = '1.1'
fields = {}
def __init__(self, action_plan, audit, strategy):
@ -170,7 +176,8 @@ class ActionPlanDeletePayload(ActionPlanPayload):
@base.WatcherObjectRegistry.register_notification
class ActionPlanCancelPayload(ActionPlanPayload):
# Version 1.0: Initial version
VERSION = '1.0'
# Version 1.1: Changed global_efficacy_type
VERSION = '1.1'
fields = {
'fault': wfields.ObjectField('ExceptionPayload', nullable=True),
}

View File

@ -363,25 +363,25 @@ class TestSyncer(base.DbTestCase):
action_plan1 = objects.ActionPlan(
self.ctx, id=1, uuid=utils.generate_uuid(),
audit_id=audit1.id, strategy_id=strategy1.id,
state='DOESNOTMATTER', global_efficacy={})
state='DOESNOTMATTER', global_efficacy=[])
# Stale after syncing because the goal of the audit has been modified
# (compared to the defined fake goals)
action_plan2 = objects.ActionPlan(
self.ctx, id=2, uuid=utils.generate_uuid(),
audit_id=audit2.id, strategy_id=strategy2.id,
state='DOESNOTMATTER', global_efficacy={})
state='DOESNOTMATTER', global_efficacy=[])
# Stale after syncing because the strategy has been modified
# (compared to the defined fake strategies)
action_plan3 = objects.ActionPlan(
self.ctx, id=3, uuid=utils.generate_uuid(),
audit_id=audit3.id, strategy_id=strategy3.id,
state='DOESNOTMATTER', global_efficacy={})
state='DOESNOTMATTER', global_efficacy=[])
# Stale after syncing because both the strategy and the related audit
# have been modified (compared to the defined fake goals/strategies)
action_plan4 = objects.ActionPlan(
self.ctx, id=4, uuid=utils.generate_uuid(),
audit_id=audit4.id, strategy_id=strategy4.id,
state='DOESNOTMATTER', global_efficacy={})
state='DOESNOTMATTER', global_efficacy=[])
action_plan1.create()
action_plan2.create()
@ -571,12 +571,12 @@ class TestSyncer(base.DbTestCase):
action_plan1 = objects.ActionPlan(
self.ctx, id=1, uuid=utils.generate_uuid(),
audit_id=audit1.id, strategy_id=strategy1.id,
state='DOESNOTMATTER', global_efficacy={})
state='DOESNOTMATTER', global_efficacy=[])
# Stale after syncing because its related goal has been soft deleted
action_plan2 = objects.ActionPlan(
self.ctx, id=2, uuid=utils.generate_uuid(),
audit_id=audit2.id, strategy_id=strategy2.id,
state='DOESNOTMATTER', global_efficacy={})
state='DOESNOTMATTER', global_efficacy=[])
action_plan1.create()
action_plan2.create()

View File

@ -95,11 +95,11 @@ class TestActionNotification(base.DbTestCase):
'state': 'ONGOING',
'action_plan': {
'watcher_object.namespace': 'watcher',
'watcher_object.version': '1.0',
'watcher_object.version': '1.1',
'watcher_object.name': 'TerseActionPlanPayload',
'watcher_object.data': {
'uuid': '76be87bd-3422-43f9-93a0-e85a577e3061',
'global_efficacy': {},
'global_efficacy': [],
'created_at': '2016-10-18T09:52:05Z',
'updated_at': None,
'state': 'ONGOING',
@ -147,11 +147,11 @@ class TestActionNotification(base.DbTestCase):
'state': 'PENDING',
'action_plan': {
'watcher_object.namespace': 'watcher',
'watcher_object.version': '1.0',
'watcher_object.version': '1.1',
'watcher_object.name': 'TerseActionPlanPayload',
'watcher_object.data': {
'uuid': '76be87bd-3422-43f9-93a0-e85a577e3061',
'global_efficacy': {},
'global_efficacy': [],
'created_at': '2016-10-18T09:52:05Z',
'updated_at': None,
'state': 'ONGOING',
@ -201,11 +201,11 @@ class TestActionNotification(base.DbTestCase):
'state': 'DELETED',
'action_plan': {
'watcher_object.namespace': 'watcher',
'watcher_object.version': '1.0',
'watcher_object.version': '1.1',
'watcher_object.name': 'TerseActionPlanPayload',
'watcher_object.data': {
'uuid': '76be87bd-3422-43f9-93a0-e85a577e3061',
'global_efficacy': {},
'global_efficacy': [],
'created_at': '2016-10-18T09:52:05Z',
'updated_at': None,
'state': 'ONGOING',
@ -257,11 +257,11 @@ class TestActionNotification(base.DbTestCase):
'state': 'PENDING',
'action_plan': {
'watcher_object.namespace': 'watcher',
'watcher_object.version': '1.0',
'watcher_object.version': '1.1',
'watcher_object.name': 'TerseActionPlanPayload',
'watcher_object.data': {
'uuid': '76be87bd-3422-43f9-93a0-e85a577e3061',
'global_efficacy': {},
'global_efficacy': [],
'created_at': '2016-10-18T09:52:05Z',
'updated_at': None,
'state': 'ONGOING',
@ -330,11 +330,11 @@ class TestActionNotification(base.DbTestCase):
'state': 'FAILED',
'action_plan': {
'watcher_object.namespace': 'watcher',
'watcher_object.version': '1.0',
'watcher_object.version': '1.1',
'watcher_object.name': 'TerseActionPlanPayload',
'watcher_object.data': {
'uuid': '76be87bd-3422-43f9-93a0-e85a577e3061',
'global_efficacy': {},
'global_efficacy': [],
'created_at': '2016-10-18T09:52:05Z',
'updated_at': None,
'state': 'ONGOING',
@ -387,11 +387,11 @@ class TestActionNotification(base.DbTestCase):
'state': 'PENDING',
'action_plan': {
'watcher_object.namespace': 'watcher',
'watcher_object.version': '1.0',
'watcher_object.version': '1.1',
'watcher_object.name': 'TerseActionPlanPayload',
'watcher_object.data': {
'uuid': '76be87bd-3422-43f9-93a0-e85a577e3061',
'global_efficacy': {},
'global_efficacy': [],
'created_at': '2016-10-18T09:52:05Z',
'updated_at': None,
'state': 'ONGOING',
@ -460,11 +460,11 @@ class TestActionNotification(base.DbTestCase):
'state': 'FAILED',
'action_plan': {
'watcher_object.namespace': 'watcher',
'watcher_object.version': '1.0',
'watcher_object.version': '1.1',
'watcher_object.name': 'TerseActionPlanPayload',
'watcher_object.data': {
'uuid': '76be87bd-3422-43f9-93a0-e85a577e3061',
'global_efficacy': {},
'global_efficacy': [],
'created_at': '2016-10-18T09:52:05Z',
'updated_at': None,
'state': 'ONGOING',

View File

@ -71,9 +71,9 @@ class TestActionPlanNotification(base.DbTestCase):
self.assertDictEqual(
{
"watcher_object.namespace": "watcher",
"watcher_object.version": "1.0",
"watcher_object.version": "1.1",
"watcher_object.data": {
"global_efficacy": {},
"global_efficacy": [],
"strategy_uuid": "cb3d0b58-4415-4d90-b75b-1e96878730e3",
"strategy": {
"watcher_object.namespace": "watcher",
@ -148,9 +148,9 @@ class TestActionPlanNotification(base.DbTestCase):
self.assertDictEqual(
{
"watcher_object.namespace": "watcher",
"watcher_object.version": "1.0",
"watcher_object.version": "1.1",
"watcher_object.data": {
"global_efficacy": {},
"global_efficacy": [],
"strategy_uuid": "cb3d0b58-4415-4d90-b75b-1e96878730e3",
"strategy": {
"watcher_object.namespace": "watcher",
@ -217,9 +217,9 @@ class TestActionPlanNotification(base.DbTestCase):
self.assertDictEqual(
{
"watcher_object.namespace": "watcher",
"watcher_object.version": "1.0",
"watcher_object.version": "1.1",
"watcher_object.data": {
"global_efficacy": {},
"global_efficacy": [],
"strategy_uuid": "cb3d0b58-4415-4d90-b75b-1e96878730e3",
"strategy": {
"watcher_object.namespace": "watcher",
@ -315,7 +315,7 @@ class TestActionPlanNotification(base.DbTestCase):
"audit_type": "ONESHOT"
}
},
"global_efficacy": {},
"global_efficacy": [],
"state": "ONGOING",
"strategy_uuid": (
"cb3d0b58-4415-4d90-b75b-1e96878730e3"),
@ -338,7 +338,7 @@ class TestActionPlanNotification(base.DbTestCase):
},
"watcher_object.name": "ActionPlanActionPayload",
"watcher_object.namespace": "watcher",
"watcher_object.version": "1.0"
"watcher_object.version": "1.1"
}
},
notification
@ -404,7 +404,7 @@ class TestActionPlanNotification(base.DbTestCase):
"watcher_object.namespace": "watcher",
"watcher_object.version": "1.2"
},
"global_efficacy": {},
"global_efficacy": [],
"state": "ONGOING",
"strategy_uuid": (
"cb3d0b58-4415-4d90-b75b-1e96878730e3"),
@ -427,7 +427,7 @@ class TestActionPlanNotification(base.DbTestCase):
},
"watcher_object.name": "ActionPlanActionPayload",
"watcher_object.namespace": "watcher",
"watcher_object.version": "1.0"
"watcher_object.version": "1.1"
}
},
notification
@ -478,7 +478,7 @@ class TestActionPlanNotification(base.DbTestCase):
"audit_type": "ONESHOT"
}
},
"global_efficacy": {},
"global_efficacy": [],
"state": "ONGOING",
"strategy_uuid": (
"cb3d0b58-4415-4d90-b75b-1e96878730e3"),
@ -501,7 +501,7 @@ class TestActionPlanNotification(base.DbTestCase):
},
"watcher_object.name": "ActionPlanCancelPayload",
"watcher_object.namespace": "watcher",
"watcher_object.version": "1.0"
"watcher_object.version": "1.1"
}
},
notification
@ -567,7 +567,7 @@ class TestActionPlanNotification(base.DbTestCase):
"watcher_object.namespace": "watcher",
"watcher_object.version": "1.2"
},
"global_efficacy": {},
"global_efficacy": [],
"state": "ONGOING",
"strategy_uuid": (
"cb3d0b58-4415-4d90-b75b-1e96878730e3"),
@ -590,7 +590,7 @@ class TestActionPlanNotification(base.DbTestCase):
},
"watcher_object.name": "ActionPlanCancelPayload",
"watcher_object.namespace": "watcher",
"watcher_object.version": "1.0"
"watcher_object.version": "1.1"
}
},
notification

View File

@ -267,15 +267,15 @@ expected_notification_fingerprints = {
'AuditActionPayload': '1.1-3d19c75dd9cdf2a833d0367b234e20d2',
'GoalPayload': '1.0-fa1fecb8b01dd047eef808ded4d50d1a',
'StrategyPayload': '1.0-94f01c137b083ac236ae82573c1fcfc1',
'ActionPlanActionPayload': '1.0-d9f134708e06cf2ff2d3b8d522ac2aa8',
'ActionPlanActionPayload': '1.1-5be9fa7ca9e544322bdded5593e36edb',
'ActionPlanCreateNotification': '1.0-9b69de0724fda8310d05e18418178866',
'ActionPlanCreatePayload': '1.0-23d0abbfa43acfd49b2b3097770efdce',
'ActionPlanCreatePayload': '1.1-6a3c3bf1d1f822e33633c49088699d4e',
'ActionPlanDeleteNotification': '1.0-9b69de0724fda8310d05e18418178866',
'ActionPlanDeletePayload': '1.0-23d0abbfa43acfd49b2b3097770efdce',
'ActionPlanPayload': '1.0-23d0abbfa43acfd49b2b3097770efdce',
'ActionPlanDeletePayload': '1.1-6a3c3bf1d1f822e33633c49088699d4e',
'ActionPlanPayload': '1.1-6a3c3bf1d1f822e33633c49088699d4e',
'ActionPlanStateUpdatePayload': '1.0-1a1b606bf14a2c468800c2b010801ce5',
'ActionPlanUpdateNotification': '1.0-9b69de0724fda8310d05e18418178866',
'ActionPlanUpdatePayload': '1.0-3e1a348a0579c6c43c1c3d7257e3f26b',
'ActionPlanUpdatePayload': '1.1-4ecd6571784cec2656725003ce431fdd',
'ActionPlanActionNotification': '1.0-9b69de0724fda8310d05e18418178866',
'ActionPlanCancelNotification': '1.0-9b69de0724fda8310d05e18418178866',
'ActionCancelNotification': '1.0-9b69de0724fda8310d05e18418178866',
@ -289,9 +289,9 @@ expected_notification_fingerprints = {
'ActionStateUpdatePayload': '1.0-1a1b606bf14a2c468800c2b010801ce5',
'ActionUpdateNotification': '1.0-9b69de0724fda8310d05e18418178866',
'ActionUpdatePayload': '1.0-03306c7e7f4d49ac328c261eff6b30b8',
'ActionPlanCancelPayload': '1.0-d9f134708e06cf2ff2d3b8d522ac2aa8',
'ActionPlanCancelPayload': '1.1-5be9fa7ca9e544322bdded5593e36edb',
'ActionCancelPayload': '1.0-bff9f820a2abf7bb6d7027b7450157df',
'TerseActionPlanPayload': '1.0-42bf7a5585cc111a9a4dbc008a04c67e',
'TerseActionPlanPayload': '1.1-63008f013817407df9194c2a59fda6b0',
'ServiceUpdateNotification': '1.0-9b69de0724fda8310d05e18418178866',
'ServicePayload': '1.0-9c5a9bc51e6606e0ec3cf95baf698f4f',
'ServiceStatusUpdatePayload': '1.0-1a1b606bf14a2c468800c2b010801ce5',