mirror of
https://github.com/mtan93/cachet-url-monitor.git
synced 2026-03-08 05:31:58 +00:00
Upgrading to python3 (#60)
* Migrating to python 3.7.2, but docker image is not working properly. Need to continue investigating why it's not properly running. * Trying to fix the build and fixing logging in the scheduler initialization. * Trying to fix the build * Collecting test results * Fixing the dockerfile * Updating the development dependencies
This commit is contained in:
@@ -10,8 +10,8 @@ import requests
|
||||
from yaml import dump
|
||||
from yaml import load
|
||||
|
||||
import latency_unit
|
||||
import status as st
|
||||
import cachet_url_monitor.latency_unit as latency_unit
|
||||
import cachet_url_monitor.status as st
|
||||
|
||||
# This is the mandatory fields that must be in the configuration file in this
|
||||
# same exact structure.
|
||||
@@ -80,7 +80,7 @@ class Configuration(object):
|
||||
def __init__(self, config_file):
|
||||
self.logger = logging.getLogger('cachet_url_monitor.configuration.Configuration')
|
||||
self.config_file = config_file
|
||||
self.data = load(file(self.config_file, 'r'))
|
||||
self.data = load(open(self.config_file, 'r'))
|
||||
self.current_fails = 0
|
||||
self.trigger_update = True
|
||||
|
||||
@@ -146,7 +146,7 @@ class Configuration(object):
|
||||
ConfigurationValidationError is raised. Otherwise nothing will happen.
|
||||
"""
|
||||
configuration_errors = []
|
||||
for key, sub_entries in configuration_mandatory_fields.iteritems():
|
||||
for key, sub_entries in configuration_mandatory_fields.items():
|
||||
if key not in self.data:
|
||||
configuration_errors.append(key)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import time
|
||||
|
||||
import schedule
|
||||
|
||||
from configuration import Configuration
|
||||
from cachet_url_monitor.configuration import Configuration
|
||||
|
||||
|
||||
class Agent(object):
|
||||
@@ -84,7 +84,7 @@ if __name__ == "__main__":
|
||||
handler.addFilter(logging.Filter('cachet_url_monitor'))
|
||||
|
||||
if len(sys.argv) <= 1:
|
||||
logging.fatal('Missing configuration file argument')
|
||||
logging.getLogger('cachet_url_monitor.scheduler').fatal('Missing configuration file argument')
|
||||
sys.exit(1)
|
||||
|
||||
scheduler = Scheduler(sys.argv[1])
|
||||
|
||||
Reference in New Issue
Block a user