Resolving pylint no-self-argument

Using per line suppression to resolve
no-self-argument errors. Not adding self
argument as suggested by pylint, as it
breaks the original code.

Story: 2007082
Task: 37996

Signed-off-by: Lu Yao Chen <luyao.chen@windriver.com>
Change-Id: I5eec5056d27ee5cc4cc7381bcdc47296a0dd22cc
This commit is contained in:
Lu Yao Chen 2020-12-10 15:23:07 -05:00
parent 9533156f60
commit c96e147299
5 changed files with 11 additions and 12 deletions

View File

@ -81,7 +81,6 @@ extension-pkg-whitelist=lxml.etree,greenlet
# W1401: anomalous-backslash-in-string
# W1505: deprecated-method
# All these errors should be fixed:
# E0213: no-self-argument
# E0604: invalid-all-object
# E0633: unpacking-non-sequence
# E0701: bad-except-order
@ -91,7 +90,7 @@ disable=C, R, fixme, W0101, W0105, W0106, W0107, W0108, W0110, W0123, W0150,
W0201, W0211, W0212, W0221, W0223, W0231, W0235, W0311, W0402, W0403,
W0404, W0603, W0612, W0613, W0621, W0622, W0631, W0632, W0701, W0703,
W1113, W1201, W1401, W1505,
E0213, E0604, E0633, E0701, E1120, E1121
E0604, E0633, E0701, E1120, E1121
[REPORTS]
# Set the output format. Available formats are text, parseable, colorized, msvs

View File

@ -488,7 +488,7 @@ class AgentManager(service.PeriodicService):
self._lldp_operator.lldp_agents_clear()
pass
def synchronized_network_config(func):
def synchronized_network_config(func): # pylint: disable=no-self-argument
""" Synchronization decorator to acquire and release
network_config_lock.
"""
@ -710,7 +710,7 @@ class AgentManager(service.PeriodicService):
return port_list, pci_device_list, host_macs
def _retry_on_missing_host_uuid(ex):
def _retry_on_missing_host_uuid(ex): # pylint: disable=no-self-argument
LOG.info('Caught missing host_uuid exception. Retrying... '
'Exception: {}'.format(ex))
return isinstance(ex, exception.LocalHostUUIDNotFound)
@ -1517,7 +1517,7 @@ class AgentManager(service.PeriodicService):
# Set the install_uuid to the value we just configured.
tsc.install_uuid = install_uuid
def _retry_on_personality_is_none(ex):
def _retry_on_personality_is_none(ex): # pylint: disable=no-self-argument
LOG.info('Caught exception. Retrying... Exception: {}'.format(ex))
return isinstance(ex, exception.LocalManagementPersonalityNotFound)
@ -1599,7 +1599,7 @@ class AgentManager(service.PeriodicService):
else:
LOG.error("report_inventory unknown request=%s" % inventory_update)
def _retry_on_missing_inventory_info(ex):
def _retry_on_missing_inventory_info(ex): # pylint: disable=no-self-argument
LOG.info('Caught exception. Retrying... Exception: {}'.format(ex))
return isinstance(ex, exception.AgentInventoryInfoNotFound)

View File

@ -5880,7 +5880,7 @@ class ConductorManager(service.PeriodicService):
# @staticmethod can't be used with @retry decorator below because
# it raises a "'staticmethod' object is not callable" exception
def _osd_must_be_down(result):
def _osd_must_be_down(result): # pylint: disable=no-self-argument
response, body = result
if not response.ok:
LOG.error("OSD remove failed: {}".format(body))

View File

@ -391,7 +391,7 @@ class Interfaces(Base):
class EthernetCommon(object):
@declared_attr
def id(cls):
def id(cls): # pylint: disable=no-self-argument
return Column(Integer, ForeignKey('interfaces.id', ondelete="CASCADE"), primary_key=True, nullable=False)
imac = Column(String(255))
@ -1194,7 +1194,7 @@ class DataNetworks(Base):
class DataNetworksCommon(object):
@declared_attr
def id(cls):
def id(cls): # pylint: disable=no-self-argument
return Column(Integer,
ForeignKey('datanetworks.id', ondelete="CASCADE"),
primary_key=True, nullable=False)
@ -1305,7 +1305,7 @@ class SensorGroups(Base):
class SensorGroupsCommon(object):
@declared_attr
def id(cls):
def id(cls): # pylint: disable=no-self-argument
return Column(Integer,
ForeignKey('i_sensorgroups.id', ondelete="CASCADE"),
primary_key=True, nullable=False)
@ -1529,7 +1529,7 @@ class DeviceImage(Base):
class DeviceImageCommon(object):
@declared_attr
def id(cls):
def id(cls): # pylint: disable=no-self-argument
return Column(Integer,
ForeignKey('device_images.id', ondelete="CASCADE"),
primary_key=True, nullable=False)

View File

@ -128,7 +128,7 @@ class TestPciOperator(base.TestCase):
def tearDown(self):
super(TestPciOperator, self).tearDown()
def mock_get_lspci_output_by_addr(addr):
def mock_get_lspci_output_by_addr(addr): # pylint: disable=no-self-argument
return FAKE_LSPCI_OUTPUT[addr]
@mock.patch.object(PCIOperator, 'get_lspci_output_by_addr',