aboutsummaryrefslogtreecommitdiffstats
path: root/asdctool/src/main/resources/es-resources/file_utils.py
blob: 743902084e6d48f9382719ee80afa822e9852fe5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import itertools
import string
import json
from datetime import datetime
from elasticsearch import Elasticsearch
import elasticsearch
import elasticsearch.helpers
from elasticsearch.client import IndicesClient
import sys, os

def readFileToJson(fileName):
   print "read file ", fileName
   fo=open(fileName)
   try:
     json_mapping=json.load(fo)
     fo.close()
   except ValueError:
     print "error in reading file " , fileName
     fo.close()
     raise
   return json_mapping