mirror of
https://github.com/mtan93/cachet-url-monitor.git
synced 2026-03-08 05:31:58 +00:00
Renaming Agent classes to decorators to comply with the design pattern
This commit is contained in:
@@ -37,12 +37,12 @@ class Decorator(object):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class UpdateStatusAgent(Decorator):
|
class UpdateStatusDecorator(Decorator):
|
||||||
def execute(self, configuration):
|
def execute(self, configuration):
|
||||||
configuration.push_status()
|
configuration.push_status()
|
||||||
|
|
||||||
|
|
||||||
class CreateIncidentAgent(Decorator):
|
class CreateIncidentDecorator(Decorator):
|
||||||
def execute(self, configuration):
|
def execute(self, configuration):
|
||||||
configuration.push_incident()
|
configuration.push_incident()
|
||||||
|
|
||||||
@@ -57,9 +57,8 @@ class Scheduler(object):
|
|||||||
|
|
||||||
def get_agent(self):
|
def get_agent(self):
|
||||||
action_names = {
|
action_names = {
|
||||||
'CREATE_INCIDENT': CreateIncidentAgent,
|
'CREATE_INCIDENT': CreateIncidentDecorator,
|
||||||
'UPDATE_STATUS': UpdateStatusAgent,
|
'UPDATE_STATUS': UpdateStatusDecorator,
|
||||||
None: Agent
|
|
||||||
}
|
}
|
||||||
actions = []
|
actions = []
|
||||||
for action in self.configuration.get_action():
|
for action in self.configuration.get_action():
|
||||||
|
|||||||
Reference in New Issue
Block a user