Renaming Agent classes to decorators to comply with the design pattern

This commit is contained in:
Mitsuo Takaki
2017-02-11 01:09:12 -08:00
parent e4bd02c44f
commit 3830063ba4

View File

@@ -37,12 +37,12 @@ class Decorator(object):
pass
class UpdateStatusAgent(Decorator):
class UpdateStatusDecorator(Decorator):
def execute(self, configuration):
configuration.push_status()
class CreateIncidentAgent(Decorator):
class CreateIncidentDecorator(Decorator):
def execute(self, configuration):
configuration.push_incident()
@@ -57,9 +57,8 @@ class Scheduler(object):
def get_agent(self):
action_names = {
'CREATE_INCIDENT': CreateIncidentAgent,
'UPDATE_STATUS': UpdateStatusAgent,
None: Agent
'CREATE_INCIDENT': CreateIncidentDecorator,
'UPDATE_STATUS': UpdateStatusDecorator,
}
actions = []
for action in self.configuration.get_action():