Commit 155ed36c authored by Kerri Wait's avatar Kerri Wait
Browse files

Adding timestamp to the description field for HPC

parent 9b4401a1
......@@ -20,7 +20,10 @@ def main():
from .influxdbwrapper import Client as influxWrapperClient
from . import component_tests
from .status import Status
import datetime
global ts
ts ="%Y-%m-%dT%H:%M:%S")
with open(args.config) as f:
config = yaml.safe_load(
......@@ -32,14 +35,12 @@ def main():
for c in spClient.components.list():
spcomponents[c['name']] = c
logger.debug("found component {}".format(c['name']))
for name,c in config['components'].items():
msgs = []
overall = Status.operational
if name not in spcomponents:
logger.error("Can't find component {}".format(name))
if name in spcomponents and spcomponents[name]['status'] == 'under_maintenance':
for t in c['tests']:
......@@ -50,10 +51,10 @@ def main():
if result['status'] != Status.operational:
if name in spcomponents:
def update_component(spclient,component,status,msg,check):
def update_component(spclient,component,status,msg,check,description):
from .status import Status
if status is Status.operational:
......@@ -66,7 +67,7 @@ def update_component(spclient,component,status,msg,check):
statusstr = 'under_maintenance'
if not check:
if statusstr != component['status']:
spclient.components.update(, status = statusstr)
spclient.components.update(, status = statusstr, description = "{}. Updated {}".format(description, ts))
if statusstr == component['status']:
print("no change {} {} {}".format(component['name'],component['status'], statusstr))
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