Merge changes If3d86e80,I48763243,I656a6786
[barometer.git] / 3rd_party / collectd-ves-app / ves_app / ves_app.py
index cf05a2b..66dc8f2 100644 (file)
 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)