From: Zack Cerza Date: Tue, 1 Apr 2014 02:57:53 +0000 (-0500) Subject: Report job updated time X-Git-Tag: 1.1.0~1550 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=2e997aa7b1d4da97156edc76f571d250e83eafb9;p=teuthology.git Report job updated time When reading job information from archive files, use the mtime of teuthology.log as the job updated time Signed-off-by: Zack Cerza --- diff --git a/teuthology/report.py b/teuthology/report.py index 6fb84be92e..d684680f7e 100644 --- a/teuthology/report.py +++ b/teuthology/report.py @@ -1,10 +1,12 @@ import os +from os.path import getmtime import yaml import json import re import requests import logging import socket +from datetime import datetime import teuthology from .config import config @@ -90,6 +92,12 @@ class ResultsSerializer(object): if partial_info is not None: job_info.update(partial_info) + log_path = os.path.join(job_archive_dir, 'teuthology.log') + if os.path.exists(log_path): + mtime = int(os.path.getmtime(log_path)) + mtime_dt = datetime.fromtimestamp(mtime) + job_info['updated'] = str(mtime_dt) + if 'job_id' not in job_info: job_info['job_id'] = job_id