From c959f9dcf9f4bc0c3dfeb4e68c082c79d479de35 Mon Sep 17 00:00:00 2001 From: Tim Bielawa Date: Fri, 26 Aug 2016 08:53:45 -0700 Subject: Fix PyLint errors discovered when upgrading to newer version * Fixes PyLint to run in the virtualenv used for all tests * Replaced 'LooseVersion' with 'parse_version' from setuptools - This is a work around for the issue in https://github.com/PyCQA/pylint/issues/73 in which pylint can not import disutils.version correctly in a virtualenv. * Removed the unused function 'delete_hosts' which was causing a pylint error as well * Removed a deprecated pylint pragma option, 'bad-builtin' * Fixed some import ordering issues it was picky about * Added another disable for a case where the PyLint suggestion would have us altering the container we would be iterating over * Add code-coverage reports to the unittests with the MINIMUM coverage percentage for success set to 70% - Current test coverage is at 76% --- utils/src/ooinstall/oo_config.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'utils/src/ooinstall/oo_config.py') diff --git a/utils/src/ooinstall/oo_config.py b/utils/src/ooinstall/oo_config.py index b9f0cc65c..409276360 100644 --- a/utils/src/ooinstall/oo_config.py +++ b/utils/src/ooinstall/oo_config.py @@ -2,10 +2,11 @@ import os import sys +import logging import yaml from pkg_resources import resource_filename -import logging + installer_log = logging.getLogger('installer') CONFIG_PERSIST_SETTINGS = [ @@ -325,6 +326,10 @@ class OOConfig(object): self.settings['ansible_inventory_path'] = \ '{}/hosts'.format(os.path.dirname(self.config_path)) + # pylint: disable=consider-iterating-dictionary + # Disabled because we shouldn't alter the container we're + # iterating over + # # clean up any empty sets for setting in self.settings.keys(): if not self.settings[setting]: -- cgit v1.2.3