Commit ae96b9ad authored by Bram Daams's avatar Bram Daams
Browse files

regel korter en extra newline

parent 9a612733
Pipeline #36631 passed with stage
in 35 seconds
venv
test.py
crnnr.egg-info
__pycache__
SmartCronHelper.egg-info/
......@@ -12,24 +12,34 @@ $ pip install .
## Test
For now, create a file `test.py`
``` python
"""
Testing hc.py
"""
from crontabs import CronTabs
from hc import HealthcheckCredentials, Healthchecks
cred = HealthcheckCredentials(
api_url='https://hc.example.com/api/v1/',
api_key='mysecretapikey'
)
api_url='https://hc.example.com/api/v1/',
api_key='mysecretapikey'
)
CRED = HealthcheckCredentials(
api_url='https://cronmon.science.ru.nl/api/v1/',
api_key='AbuQXRDCqBk_Q9SiPRfmJA2KtvbNWKx4'
)
h = Healthchecks(cred)
h.PrintStatus()
H = Healthchecks(CRED)
H.print_status()
jobs = CronTabs().all.find_command('JOB_ID')
for job in jobs:
check = h.find_check(job)
JOBS = CronTabs().all.find_command('JOB_ID')
for job in JOBS:
check = H.find_check(job)
if check:
h.update_check(check, job)
H.update_check(check, job)
else:
h.new_check(job)
H.new_check(job)
```
And run it within the virtual environment
......
......@@ -12,7 +12,11 @@ import click
import requests
import tzlocal
HealthcheckCredentials = collections.namedtuple('HealthcheckCredentials', 'api_url api_key')
HealthcheckCredentials = collections.namedtuple(
'HealthcheckCredentials',
'api_url api_key'
)
class Healthchecks:
"""
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment