From dbab6b60fe8bb424b2d030d792aab2899ac362d7 Mon Sep 17 00:00:00 2001 From: Mikhail S Medvedev Date: Tue, 22 Sep 2015 16:43:55 -0500 Subject: [PATCH] Remove hardcoded data path Use the conf setting instead. Change-Id: I3350d1c23201d80941699690a522c1727acbbc3e --- monitoring/ciwatch/ciwatch/populate.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/monitoring/ciwatch/ciwatch/populate.py b/monitoring/ciwatch/ciwatch/populate.py index 028baa2..71be64d 100644 --- a/monitoring/ciwatch/ciwatch/populate.py +++ b/monitoring/ciwatch/ciwatch/populate.py @@ -12,13 +12,16 @@ # License for the specific language governing permissions and limitations # under the License. +import os + from ciwatch import db from ciwatch.events import parse_json_event, add_event_to_db +from ciwatch.log import DATA_DIR def get_data(): data = [] - with open('/var/data/third-party-ci.log') as file_: + with open(os.path.join(DATA_DIR, 'third-party-ci.log')) as file_: for line in file_: event = parse_json_event(line) if event is not None: