Removed unused 'alarm' field
The 'alarm' field is currently unused, so it has been removed. Change-Id: I02fa15b06ed49dbc5dd63de54a9cde601413983c Closes-Bug: #1550261
This commit is contained in:
parent
0f14b7635d
commit
408d6d4650
|
@ -130,9 +130,6 @@ class Action(base.APIBase):
|
||||||
state = wtypes.text
|
state = wtypes.text
|
||||||
"""This audit state"""
|
"""This audit state"""
|
||||||
|
|
||||||
alarm = types.uuid
|
|
||||||
"""An alarm UUID related to this action"""
|
|
||||||
|
|
||||||
action_type = wtypes.text
|
action_type = wtypes.text
|
||||||
"""Action type"""
|
"""Action type"""
|
||||||
|
|
||||||
|
@ -194,7 +191,6 @@ class Action(base.APIBase):
|
||||||
sample = cls(uuid='27e3153e-d5bf-4b7e-b517-fb518e17f34c',
|
sample = cls(uuid='27e3153e-d5bf-4b7e-b517-fb518e17f34c',
|
||||||
description='action description',
|
description='action description',
|
||||||
state='PENDING',
|
state='PENDING',
|
||||||
alarm=None,
|
|
||||||
created_at=datetime.datetime.utcnow(),
|
created_at=datetime.datetime.utcnow(),
|
||||||
deleted_at=None,
|
deleted_at=None,
|
||||||
updated_at=datetime.datetime.utcnow())
|
updated_at=datetime.datetime.utcnow())
|
||||||
|
|
|
@ -281,8 +281,6 @@ class Connection(api.BaseConnection):
|
||||||
|
|
||||||
if 'state' in filters:
|
if 'state' in filters:
|
||||||
query = query.filter_by(state=filters['state'])
|
query = query.filter_by(state=filters['state'])
|
||||||
if 'alarm' in filters:
|
|
||||||
query = query.filter_by(alarm=filters['alarm'])
|
|
||||||
|
|
||||||
query = self.__add_soft_delete_mixin_filters(
|
query = self.__add_soft_delete_mixin_filters(
|
||||||
query, filters, models.Action)
|
query, filters, models.Action)
|
||||||
|
|
|
@ -161,8 +161,6 @@ class Action(Base):
|
||||||
action_type = Column(String(255), nullable=False)
|
action_type = Column(String(255), nullable=False)
|
||||||
input_parameters = Column(JSONEncodedDict, nullable=True)
|
input_parameters = Column(JSONEncodedDict, nullable=True)
|
||||||
state = Column(String(20), nullable=True)
|
state = Column(String(20), nullable=True)
|
||||||
# todo(jed) remove parameter alarm
|
|
||||||
alarm = Column(String(36))
|
|
||||||
next = Column(String(36), nullable=True)
|
next = Column(String(36), nullable=True)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,6 @@ class DefaultPlanner(base.BasePlanner):
|
||||||
'action_type': action_type,
|
'action_type': action_type,
|
||||||
'input_parameters': input_parameters,
|
'input_parameters': input_parameters,
|
||||||
'state': objects.action.State.PENDING,
|
'state': objects.action.State.PENDING,
|
||||||
'alarm': None,
|
|
||||||
'next': None,
|
'next': None,
|
||||||
}
|
}
|
||||||
return action
|
return action
|
||||||
|
|
|
@ -44,8 +44,6 @@ class Action(base.WatcherObject):
|
||||||
'action_type': obj_utils.str_or_none,
|
'action_type': obj_utils.str_or_none,
|
||||||
'input_parameters': obj_utils.dict_or_none,
|
'input_parameters': obj_utils.dict_or_none,
|
||||||
'state': obj_utils.str_or_none,
|
'state': obj_utils.str_or_none,
|
||||||
# todo(jed) remove parameter alarm
|
|
||||||
'alarm': obj_utils.str_or_none,
|
|
||||||
'next': obj_utils.int_or_none,
|
'next': obj_utils.int_or_none,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,6 @@ class TestDefaultWorkFlowEngine(base.DbTestCase):
|
||||||
'action_type': action_type,
|
'action_type': action_type,
|
||||||
'input_parameters': parameters,
|
'input_parameters': parameters,
|
||||||
'state': objects.action.State.PENDING,
|
'state': objects.action.State.PENDING,
|
||||||
'alarm': None,
|
|
||||||
'next': next,
|
'next': next,
|
||||||
}
|
}
|
||||||
new_action = objects.Action(self.context, **action)
|
new_action = objects.Action(self.context, **action)
|
||||||
|
|
|
@ -266,24 +266,21 @@ class DbActionTestCase(base.DbTestCase):
|
||||||
description='description action 1',
|
description='description action 1',
|
||||||
uuid=w_utils.generate_uuid(),
|
uuid=w_utils.generate_uuid(),
|
||||||
next=None,
|
next=None,
|
||||||
state='PENDING',
|
state='PENDING')
|
||||||
alarm=None)
|
|
||||||
action2 = self._create_test_action(
|
action2 = self._create_test_action(
|
||||||
id=2,
|
id=2,
|
||||||
action_plan_id=2,
|
action_plan_id=2,
|
||||||
description='description action 2',
|
description='description action 2',
|
||||||
uuid=w_utils.generate_uuid(),
|
uuid=w_utils.generate_uuid(),
|
||||||
next=action1['uuid'],
|
next=action1['uuid'],
|
||||||
state='PENDING',
|
state='PENDING')
|
||||||
alarm=None)
|
|
||||||
action3 = self._create_test_action(
|
action3 = self._create_test_action(
|
||||||
id=3,
|
id=3,
|
||||||
action_plan_id=1,
|
action_plan_id=1,
|
||||||
description='description action 3',
|
description='description action 3',
|
||||||
uuid=w_utils.generate_uuid(),
|
uuid=w_utils.generate_uuid(),
|
||||||
next=action2['uuid'],
|
next=action2['uuid'],
|
||||||
state='ONGOING',
|
state='ONGOING')
|
||||||
alarm=None)
|
|
||||||
res = self.dbapi.get_action_list(self.context,
|
res = self.dbapi.get_action_list(self.context,
|
||||||
filters={'state': 'ONGOING'})
|
filters={'state': 'ONGOING'})
|
||||||
self.assertEqual([action3['id']], [r.id for r in res])
|
self.assertEqual([action3['id']], [r.id for r in res])
|
||||||
|
|
|
@ -91,7 +91,6 @@ def get_test_action(**kwargs):
|
||||||
'resource_id':
|
'resource_id':
|
||||||
'10a47dd1-4874-4298-91cf-eff046dbdb8d'}),
|
'10a47dd1-4874-4298-91cf-eff046dbdb8d'}),
|
||||||
'state': kwargs.get('state', 'PENDING'),
|
'state': kwargs.get('state', 'PENDING'),
|
||||||
'alarm': kwargs.get('alarm', None),
|
|
||||||
'next': kwargs.get('next', 2),
|
'next': kwargs.get('next', 2),
|
||||||
'created_at': kwargs.get('created_at'),
|
'created_at': kwargs.get('created_at'),
|
||||||
'updated_at': kwargs.get('updated_at'),
|
'updated_at': kwargs.get('updated_at'),
|
||||||
|
|
Loading…
Reference in New Issue