Merge changes If3d86e80,I48763243,I656a6786
authorMatthias Runge <mrunge@redhat.com>
Tue, 17 Dec 2019 14:43:08 +0000 (14:43 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Tue, 17 Dec 2019 14:43:08 +0000 (14:43 +0000)
* changes:
  Relative imports fix
  Python 2 to 3 migration fixes
  Python 2 to 3 migration of collectd-ves-app

1  2 
3rd_party/collectd-ves-app/ves_app/ves_app.py

@@@ -1,27 -1,28 +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
  
@@@ -35,7 -36,6 +39,6 @@@ except ImportError
      # Fall back to Python 2's urllib2
      import urllib2 as url
  
  class VESApp(Normalizer):
      """VES Application"""
  
      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)