diff options
author | Pawel Tomaszewski <pawelx.tomaszewski@intel.com> | 2019-11-05 08:46:45 +0000 |
---|---|---|
committer | Emma Foley <efoley@redhat.com> | 2019-12-18 12:04:26 +0000 |
commit | 32d15ec5f1f2f0277fb7a6d03603498f169ed19d (patch) | |
tree | 9d83117680fcb117c8a227cbfa46a69b27b94101 /3rd_party/collectd-ves-app/ves_app/ves_app.py | |
parent | 200cd063ee7b1a81a6a0757c74c0d9350f6d1da9 (diff) |
Python 2 to 3 migration of collectd-ves-app
Change-Id: I656a67864d821454e5ecc1ed60ce601c872da23d
Signed-off-by: Pawel Tomaszewski <pawelx.tomaszewski@intel.com>
Signed-off-by: Kamil Wiatrowski <kamilx.wiatrowski@intel.com>
(cherry picked from commit ac61abf57582a8489ecd2d29d3211e154d3de217)
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 | 16 |
1 files changed, 5 insertions, 11 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..fa4e9349 100644 --- a/3rd_party/collectd-ves-app/ves_app/ves_app.py +++ b/3rd_party/collectd-ves-app/ves_app/ves_app.py @@ -15,23 +15,17 @@ import json import sys import base64 -import ConfigParser +import configparser import logging import argparse from distutils.util import strtobool from kafka import KafkaConsumer -from normalizer import Normalizer -from normalizer import CollectdValue - -try: - # For Python 3.0 and later - import urllib.request as url -except ImportError: - # Fall back to Python 2's urllib2 - import urllib2 as url +from .normalizer import Normalizer +from .normalizer import CollectdValue +import urllib.request as url class VESApp(Normalizer): """VES Application""" @@ -110,7 +104,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) |