Module: check_mk
Branch: master
Commit: 4b76e95534947ffe7f0aaf2ab82078ab6a0f1618
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4b76e95534947f…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Fri Jul 27 09:21:17 2018 +0200
Fixed and enabled reimported warning.
Change-Id: Idc06f4543e0515caea5c059194b769dd4b855cd9
---
cmk/gui/key_mgmt.py | 1 -
cmk/gui/plugins/sidebar/shipped.py | 1 -
cmk/gui/plugins/views/inventory.py | 1 -
cmk/gui/plugins/views/layouts.py | 1 -
cmk/gui/plugins/wato/builtin_attributes.py | 3 +--
cmk_base/config.py | 1 -
cmk_base/discovery.py | 1 -
cmk_base/modes/check_mk.py | 1 -
cmk_base/notify.py | 1 -
tests/pylint/pylintrc | 1 -
tests/pylint/test_pylint.py | 6 ++++--
11 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/cmk/gui/key_mgmt.py b/cmk/gui/key_mgmt.py
index d796a75..d8db8f9 100644
--- a/cmk/gui/key_mgmt.py
+++ b/cmk/gui/key_mgmt.py
@@ -507,7 +507,6 @@ def create_self_signed_cert(pkey):
def decrypt_private_key(encrypted_private_key, passphrase):
- from OpenSSL import crypto
try:
return crypto.load_privatekey(crypto.FILETYPE_PEM, encrypted_private_key,
passphrase)
except crypto.Error, e:
diff --git a/cmk/gui/plugins/sidebar/shipped.py b/cmk/gui/plugins/sidebar/shipped.py
index b09d7b4..0110c19 100644
--- a/cmk/gui/plugins/sidebar/shipped.py
+++ b/cmk/gui/plugins/sidebar/shipped.py
@@ -922,7 +922,6 @@ table.performance td.right {
# '----------------------------------------------------------------------'
def render_current_time():
- import time
html.div(time.strftime("%H:%M"), class_="time")
sidebar_snapins["time"] = {
diff --git a/cmk/gui/plugins/views/inventory.py b/cmk/gui/plugins/views/inventory.py
index 0c84cc9..f2839c6 100644
--- a/cmk/gui/plugins/views/inventory.py
+++ b/cmk/gui/plugins/views/inventory.py
@@ -51,7 +51,6 @@ from cmk.gui.plugins.visuals.inventory import (
FilterInvtableInterfaceType,
FilterInvtableTimestampAsAge,
FilterInvtableText,
- FilterInvtableIDRange,
)
from . import (
diff --git a/cmk/gui/plugins/views/layouts.py b/cmk/gui/plugins/views/layouts.py
index af2ee71..d071da4 100644
--- a/cmk/gui/plugins/views/layouts.py
+++ b/cmk/gui/plugins/views/layouts.py
@@ -43,7 +43,6 @@ from . import (
group_value,
EmptyCell,
output_csv_headers,
- group_value,
)
def init_rowselect(view):
diff --git a/cmk/gui/plugins/wato/builtin_attributes.py
b/cmk/gui/plugins/wato/builtin_attributes.py
index 8b78291..fc38201 100644
--- a/cmk/gui/plugins/wato/builtin_attributes.py
+++ b/cmk/gui/plugins/wato/builtin_attributes.py
@@ -33,8 +33,7 @@ from cmk.gui.globals import html
from cmk.gui.htmllib import HTML
from cmk.gui.valuespec import HostAddress, ListOf, ListOfStrings, Dictionary, Age, \
TimeofdayRange, Checkbox, DropdownChoice, Integer, CascadingDropdown, Tuple, \
- IPv4Address, RegExp, Alternative, FixedValue, AbsoluteDate, FixedValue, TextUnicode,
\
- SiteChoice
+ IPv4Address, RegExp, Alternative, FixedValue, AbsoluteDate, TextUnicode, SiteChoice
from cmk.gui.exceptions import MKUserError
from . import \
diff --git a/cmk_base/config.py b/cmk_base/config.py
index a946a5e..9bc15b6 100644
--- a/cmk_base/config.py
+++ b/cmk_base/config.py
@@ -564,7 +564,6 @@ class PackedConfig(object):
store.save_file(self._path + ".orig", helper_config + "\n")
- import marshal
code = compile(helper_config, '<string>', 'exec')
with open(self._path + ".compiled", "w") as compiled_file:
marshal.dump(code, compiled_file)
diff --git a/cmk_base/discovery.py b/cmk_base/discovery.py
index 37f0201..c7e731b 100644
--- a/cmk_base/discovery.py
+++ b/cmk_base/discovery.py
@@ -625,7 +625,6 @@ def _discovery_filter_by_lists(hostname, check_plugin_name, item,
whitelist, bla
# TODO: Move to livestatus module!
def schedule_discovery_check(hostname):
try:
- import socket
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
s.connect(cmk.paths.livestatus_unix_socket)
now = int(time.time())
diff --git a/cmk_base/modes/check_mk.py b/cmk_base/modes/check_mk.py
index 7ee1ecd..99c970e 100644
--- a/cmk_base/modes/check_mk.py
+++ b/cmk_base/modes/check_mk.py
@@ -1342,7 +1342,6 @@ modes.register(Mode(
# '----------------------------------------------------------------------'
def mode_notify(options, *args):
- import cmk_base.config as config
import cmk_base.notify as notify
config.load(with_conf_d=True, validate_hosts=False)
# TODO: Fix the code and remove the pragma below!
diff --git a/cmk_base/notify.py b/cmk_base/notify.py
index df8acbf..d33fa9b 100644
--- a/cmk_base/notify.py
+++ b/cmk_base/notify.py
@@ -1869,7 +1869,6 @@ def substitute_context(template, context):
def format_exception():
import traceback
import StringIO
- import sys
txt = StringIO.StringIO()
t, v, tb = sys.exc_info()
diff --git a/tests/pylint/pylintrc b/tests/pylint/pylintrc
index 23a90f2..682b1cf 100644
--- a/tests/pylint/pylintrc
+++ b/tests/pylint/pylintrc
@@ -19,7 +19,6 @@ disable=
no-else-return,
no-self-use,
protected-access,
- reimported,
relative-import,
#---------------------------------------------------------------------------
# We should really enable this, there could be some real exceptions waiting
diff --git a/tests/pylint/test_pylint.py b/tests/pylint/test_pylint.py
index cd76122..27349b6 100755
--- a/tests/pylint/test_pylint.py
+++ b/tests/pylint/test_pylint.py
@@ -121,9 +121,9 @@ 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\n")
pylint_cmk.add_file(f, repo_path() + "/cmk_base/check_api.py")
- # This pylint warning is incompatible with our "concatenation
technology".
- f.write("# pylint: disable=ungrouped-imports\n")
pylint_cmk.add_file(f, repo_path() + "/cmk_base/inventory_plugins.py")
# Now add the checks
@@ -139,6 +139,8 @@ def _compile_bakery_plugins(pylint_test_dir):
with open(pylint_test_dir + "/cmk_bakery_plugins.py", "w") as f:
pylint_cmk.add_file(f, os.path.realpath(os.path.join(cmc_path(),
"cmk_base/cee/agent_bakery_plugins.py")))
+ # This pylint warning is incompatible with our "concatenation
technology".
+ f.write("# pylint: disable=reimported\n")
# Also add bakery plugins
for path in pylint_cmk.check_files(os.path.join(cmc_path(),
"agents/bakery")):