Re-enable important py3k checks for ha

Re-enabling some of the disabled tox warnings present on
the pylint.rc file

Re-enabling:

print-statement (E1601)

Test Plan: Sanity test run on AIO-SX:

PASS: test_system_health_pre_session[pods]
PASS: test_system_health_pre_session[alarms]
PASS: test_system_health_pre_session[system_apps]
PASS: test_wr_analytics[deploy_and_remove]
PASS: test_horizon_host_inventory_display
PASS: test_lock_unlock_host[controller]
PASS: test_pod_to_pod_connection
PASS: test_pod_to_service_connection
PASS: test_host_to_service_connection

Story: 2006796
Task: 43434
Signed-off-by: Bernardo Decco <bernardo.deccodesiqueira@windriver.com>
Change-Id: I4b8b1dcec40d1255edccaa8873af558c382a4f67
This commit is contained in:
Bernardo Decco 2021-09-24 16:41:52 -03:00
parent acd187ffdb
commit 43ca8bc29c
19 changed files with 32 additions and 20 deletions

View File

@ -131,11 +131,6 @@ enable=E1603,E1609,E1610,E1602,E1606,E1608,E1607,E1605,E1604,E1601,E1611,W1652,
# W1201 logging-not-lazy
# W1401 anomalous-backslash-in-string
# W1618: no-absolute-import
# W1619: old-division
# W1641: eq-without-hash
# W1645: exception-message-attribute
# W1649: deprecated-string-function
# W1653: next-method-defined
#
# The following are errors which should be fixed
#
@ -151,13 +146,11 @@ enable=E1603,E1609,E1610,E1602,E1606,E1608,E1607,E1605,E1604,E1601,E1611,W1652,
# not-callable (E1102)
# too-many-function-args (E1121)
# unsubscriptable-object (E1136)
# print-statement (E1601)
disable=C, R,
W0102, W0107, W0110, W0120, W0201, W0212, W0221, W0223, W0231, W0235, W0402, W0403,
W0511, W0603, W0611, W0612, W0613, W0621, W0622, W0702, W0703, W1113, W1201, W1401,
W1618, W1619, W1641, W1645, W1649, W1653,
E0202, E0203, E0602, E0604, E0611, E0702, E0711, E1003, E1101, E1102, E1121, E1136,
E1601
W1618,
E0202, E0203, E0602, E0604, E0611, E0702, E0711, E1003, E1101, E1102, E1121, E1136

View File

@ -3,6 +3,8 @@
#
# SPDX-License-Identifier: Apache-2.0
#
from __future__ import print_function
import os
import sys
import argparse

View File

@ -140,7 +140,7 @@ class SmApiException(Exception):
if not message:
try:
message = self.message % kwargs
message = self.message % kwargs # pylint: disable=W1645
except Exception as e:
# kwargs doesn't match a variable in the message
@ -153,7 +153,7 @@ class SmApiException(Exception):
raise e
else:
# at least get the core message out if something happened
message = self.message
message = self.message # pylint: disable=W1645
super(SmApiException, self).__init__(message)

View File

@ -73,7 +73,7 @@ class ModelBase(object):
self._i = iter(columns)
return self
def next(self):
def next(self): # pylint: disable=next-method-defined
n = next(self._i)
return n, getattr(self, n)

View File

@ -345,7 +345,7 @@ class LogConfigError(Exception):
self.err_msg = err_msg
def __str__(self):
return self.message % dict(log_config=self.log_config,
return self.message % dict(log_config=self.log_config, # pylint: disable=W1645
err_msg=self.err_msg)
@ -560,4 +560,4 @@ class DeprecatedConfig(Exception):
message = _("Fatal call to deprecated config: %(msg)s")
def __init__(self, msg):
super(Exception, self).__init__(self.message % dict(msg=msg))
super(Exception, self).__init__(self.message % dict(msg=msg)) # pylint: disable=W1645

View File

@ -23,7 +23,6 @@ from six.moves import configparser
import logging
import logging.handlers
import os
import string
from sm_api.openstack.common.rootwrap import filters
@ -116,7 +115,7 @@ def load_filters(filters_path):
filterconfig = configparser.RawConfigParser()
filterconfig.read(os.path.join(filterdir, filterfile))
for (name, value) in filterconfig.items("Filters"):
filterdefinition = [string.strip(s) for s in value.split(',')]
filterdefinition = [str.strip(s) for s in value.split(',')]
newfilter = build_filter(*filterdefinition)
if newfilter is None:
continue

View File

@ -83,7 +83,7 @@ class RPCException(Exception):
if not message:
try:
message = self.message % kwargs
message = self.message % kwargs # pylint: disable=W1645
except Exception:
# kwargs doesn't match a variable in the message
@ -92,7 +92,7 @@ class RPCException(Exception):
for name, value in kwargs.items():
LOG.error("%s: %s" % (name, value))
# at least get the core message out if something happened
message = self.message
message = self.message # pylint: disable=W1645
super(RPCException, self).__init__(message)

View File

@ -174,7 +174,7 @@ def delta_seconds(before, after):
return delta.total_seconds()
except AttributeError:
return ((delta.days * 24 * 3600) + delta.seconds +
float(delta.microseconds) / (10 ** 6))
float(delta.microseconds) / (10 ** 6)) # pylint: disable=old-division
def is_soon(dt, window):

View File

@ -137,6 +137,9 @@ class Resource(object):
return self.id == other.id
return self._info == other._info
def __hash__(self):
return hash(self.manager, self._info, self._loaded)
def is_loaded(self):
return self._loaded

View File

@ -289,7 +289,7 @@ class ResponseBodyIterator(object):
while True:
yield next(self)
def next(self):
def next(self): # pylint: disable=next-method-defined
chunk = self.resp.read(CHUNKSIZE)
if chunk:
return chunk

View File

@ -6,6 +6,7 @@
# SPDX-License-Identifier: Apache-2.0
#
#
from __future__ import print_function
from sm_client import exc
from sm_client.common import utils

View File

@ -6,6 +6,8 @@
# SPDX-License-Identifier: Apache-2.0
#
#
from __future__ import print_function
import socket
from sm_client.common import utils

View File

@ -6,6 +6,7 @@
# SPDX-License-Identifier: Apache-2.0
#
#
from __future__ import print_function
from sm_client.common import utils
from sm_client import exc

View File

@ -3,6 +3,8 @@
#
# SPDX-License-Identifier: Apache-2.0
#
from __future__ import print_function
import os
import sys
import argparse

View File

@ -4,6 +4,8 @@
# SPDX-License-Identifier: Apache-2.0
#
from __future__ import print_function
import time
import socket

View File

@ -3,6 +3,7 @@
#
# SPDX-License-Identifier: Apache-2.0
#
from __future__ import print_function
import sys
import argparse
import sqlite3

View File

@ -3,6 +3,8 @@
#
# SPDX-License-Identifier: Apache-2.0
#
from __future__ import print_function
import os
import sys
import argparse

View File

@ -3,6 +3,8 @@
#
# SPDX-License-Identifier: Apache-2.0
#
from __future__ import print_function
import os
import sys
import argparse

View File

@ -3,6 +3,8 @@
#
# SPDX-License-Identifier: Apache-2.0
#
from __future__ import print_function
import os
import sys
import argparse