mirror of
https://github.com/mtan93/cachet-url-monitor.git
synced 2026-03-08 05:31:58 +00:00
Make update status optional
This commit is contained in:
@@ -94,6 +94,12 @@ class Configuration(object):
|
||||
"""
|
||||
return 'create_incident' in self.data['cachet'] and self.data['cachet']['create_incident']
|
||||
|
||||
def is_update_status(self):
|
||||
"""Will verify if the configuration is set to update status or not.
|
||||
:return True if the configuration is set to update status or False it otherwise.
|
||||
"""
|
||||
return 'update_status' in self.data['cachet'] and self.data['cachet']['update_status']
|
||||
|
||||
def validate(self):
|
||||
"""Validates the configuration by verifying the mandatory fields are
|
||||
present and in the correct format. If the validation fails, a
|
||||
|
||||
@@ -51,8 +51,10 @@ class Scheduler(object):
|
||||
|
||||
if self.configuration.is_create_incident():
|
||||
self.agent = CreateIncidentAgent(self.configuration)
|
||||
else:
|
||||
elif self.configuration.is_update_status():
|
||||
self.agent = UpdateStatusAgent(self.configuration)
|
||||
else:
|
||||
self.agent = Agent(self.configuration)
|
||||
|
||||
self.stop = False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user