Skip to content
Permalink
Browse files

Final step to enable "redefined-outer-name" pylint checker

Needed some suppressions in different places, but it's ok for the
moment. And we have another enabled checker. yay!

Change-Id: I2bfba4d6d2b41bf678d83d835f8c26edb1c7ca88
  • Loading branch information...
LarsMichelsen committed Feb 22, 2019
1 parent 102000f commit 2e88db761b207e24eb109fe39499302c7b01e4d3
@@ -43,11 +43,6 @@ disable=
# uncover bugs. Fixing this is not rocket science, just some work.
inconsistent-return-statements,
#---------------------------------------------------------------------------
# Enabling this would enhance readability quite a bit and it might even
# uncover bugs. Fixing this is not rocket science, just some work: Roughly
# 400 warnings in about 60 modules, but this can be fixed step by step.
redefined-outer-name,
#---------------------------------------------------------------------------
# Enabling this would be nice, but not crucial. Nevertheless, this would
# improve readability and involve some cleanups in our class hierarchy, so
# we should do this some day.
@@ -518,7 +518,7 @@ def _create_sample_config():
save_notification_rules(notification_rules)

try:
import cmk.gui.cee.plugins.wato.sample_config
import cmk.gui.cee.plugins.wato.sample_config # pylint: disable=redefined-outer-name
cmk.gui.cee.plugins.wato.sample_config.create_cee_sample_config()
except ImportError:
pass
@@ -445,7 +445,7 @@ def start(self,

def _verify_valid_host_config(self):
# TODO: Cleanup this local import
import cmk.gui.watolib.hosts_and_folders
import cmk.gui.watolib.hosts_and_folders # pylint: disable=redefined-outer-name
defective_hosts = cmk.gui.watolib.hosts_and_folders.validate_all_hosts([], force_all=True)
if defective_hosts:
raise MKUserError(
@@ -542,7 +542,7 @@ def _save_activation(self):
# the activation)
def _pre_activate_changes(self):
# TODO: Cleanup this local import
import cmk.gui.watolib.hosts_and_folders
import cmk.gui.watolib.hosts_and_folders # pylint: disable=redefined-outer-name
try:
if hooks.registered('pre-distribute-changes'):
hooks.call("pre-distribute-changes",
@@ -677,7 +677,7 @@ def _get_replication_components(self, site_id):

def create_site_globals_file(self, site_id, tmp_dir, sites=None):
# TODO: Cleanup this local import
import cmk.gui.watolib.sites
import cmk.gui.watolib.sites # pylint: disable=redefined-outer-name

try:
os.makedirs(tmp_dir)
@@ -178,7 +178,7 @@ def check_mk_remote_automation(site_id,
# If the site is not up-to-date, synchronize it first.
def sync_changes_before_remote_automation(site_id):
# TODO: Cleanup this local import
import cmk.gui.watolib.activate_changes
import cmk.gui.watolib.activate_changes # pylint: disable=redefined-outer-name
manager = cmk.gui.watolib.activate_changes.ActivateChangesManager()
manager.load()

@@ -213,7 +213,7 @@ def sync_changes_before_remote_automation(site_id):
def call_hook_pre_activate_changes():
if hooks.registered('pre-activate-changes'):
# TODO: Cleanup this local import
import cmk.gui.watolib.hosts_and_folders
import cmk.gui.watolib.hosts_and_folders # pylint: disable=redefined-outer-name
hooks.call("pre-activate-changes", cmk.gui.watolib.hosts_and_folders.collect_all_hosts())


@@ -229,7 +229,7 @@ def call_hook_pre_activate_changes():
def call_hook_activate_changes():
if hooks.registered('activate-changes'):
# TODO: Cleanup this local import
import cmk.gui.watolib.hosts_and_folders
import cmk.gui.watolib.hosts_and_folders # pylint: disable=redefined-outer-name
hooks.call("activate-changes", cmk.gui.watolib.hosts_and_folders.collect_all_hosts())


@@ -129,7 +129,7 @@ def inv_tree(path, default_value=None):
# add the modules
# These pylint warnings are incompatible with our "concatenation technology".
f.write(
"# pylint: disable=reimported,ungrouped-imports,wrong-import-order,wrong-import-position\n"
"# pylint: disable=reimported,ungrouped-imports,wrong-import-order,wrong-import-position,redefined-outer-name\n"
)
pylint_cmk.add_file(f, repo_path() + "/cmk_base/check_api.py")
pylint_cmk.add_file(f, repo_path() + "/cmk_base/inventory_plugins.py")

0 comments on commit 2e88db7

Please sign in to comment.
You can’t perform that action at this time.