diff options
Diffstat (limited to '3rd_party/collectd-ves-app/ves_app/ves_app.py')
-rw-r--r-- | 3rd_party/collectd-ves-app/ves_app/ves_app.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/3rd_party/collectd-ves-app/ves_app/ves_app.py b/3rd_party/collectd-ves-app/ves_app/ves_app.py index 105c66e2..66dc8f2d 100644 --- a/3rd_party/collectd-ves-app/ves_app/ves_app.py +++ b/3rd_party/collectd-ves-app/ves_app/ves_app.py @@ -1,24 +1,31 @@ #!/usr/bin/env python # +# Copyright(c) 2017-2019 Intel Corporation and OPNFV. All rights reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# import json import sys import base64 -import ConfigParser import logging import argparse +try: + import configparser +except ImportError: + import ConfigParser as configparser + from distutils.util import strtobool from kafka import KafkaConsumer @@ -32,7 +39,6 @@ except ImportError: # Fall back to Python 2's urllib2 import urllib2 as url - class VESApp(Normalizer): """VES Application""" @@ -110,7 +116,7 @@ class VESApp(Normalizer): def init(self, configfile, schema_file): if configfile is not None: # read VES configuration file if provided - config = ConfigParser.ConfigParser() + config = configparser.ConfigParser() config.optionxform = lambda option: option config.read(configfile) self.config(config) |