aboutsummaryrefslogtreecommitdiffstats
path: root/3rd_party/collectd-ves-app/ves_app/ves_app.py
diff options
context:
space:
mode:
authorMatthias Runge <mrunge@redhat.com>2019-12-17 14:43:08 +0000
committerGerrit Code Review <gerrit@opnfv.org>2019-12-17 14:43:08 +0000
commit590ccb07f4511271a90dbd31746b09ca4fee09ab (patch)
treeae40eb37eaf3daefc68f7fcc14f5cea918916005 /3rd_party/collectd-ves-app/ves_app/ves_app.py
parentaaefdd5faa4433a016785effc662cea060d46862 (diff)
parent70a1a62034a9aae01901fcc02ed5a8f1c48d7566 (diff)
Merge changes If3d86e80,I48763243,I656a6786
* changes: Relative imports fix Python 2 to 3 migration fixes Python 2 to 3 migration of collectd-ves-app
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.py9
1 files changed, 6 insertions, 3 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 cf05a2b1..66dc8f2d 100644
--- a/3rd_party/collectd-ves-app/ves_app/ves_app.py
+++ b/3rd_party/collectd-ves-app/ves_app/ves_app.py
@@ -18,10 +18,14 @@
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
@@ -35,7 +39,6 @@ except ImportError:
# Fall back to Python 2's urllib2
import urllib2 as url
-
class VESApp(Normalizer):
"""VES Application"""
@@ -113,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)