Clean up pointless statements (#79941)

* Add ignores for intentional pointless statements

* Remove redundant docstring

* Fix function docstring placement
pull/79943/head
Matt Clay 2 years ago committed by GitHub
parent 1ba100a3b4
commit 02f6e40534
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -160,7 +160,7 @@ if not HAS_SSLCONTEXT and HAS_SSL:
libssl = ctypes.CDLL(libssl_name)
for method in ('TLSv1_1_method', 'TLSv1_2_method'):
try:
libssl[method]
libssl[method] # pylint: disable=pointless-statement
# Found something - we'll let openssl autonegotiate and hope
# the server has disabled sslv2 and 3. best we can do.
PROTOCOL = ssl.PROTOCOL_SSLv23

@ -568,7 +568,7 @@ class YumModule(YumDnf):
# A sideeffect of accessing conf is that the configuration is
# loaded and plugins are discovered
self.yum_base.conf
self.yum_base.conf # pylint: disable=pointless-statement
try:
for rid in self.disablerepo:

@ -360,7 +360,6 @@ class CliconfBase(AnsiblePlugin):
remote host before triggering timeout exception
:return: None
"""
"""Fetch file over scp/sftp from remote device"""
ssh = self._connection.paramiko_conn._connect_uncached()
if proto == 'scp':
if not HAS_SCP:

@ -192,8 +192,8 @@ def ternary(value, true_val, false_val, none_val=None):
def regex_escape(string, re_type='python'):
"""Escape all regular expressions special characters from STRING."""
string = to_text(string, errors='surrogate_or_strict', nonstring='simplerepr')
'''Escape all regular expressions special characters from STRING.'''
if re_type == 'python':
return re.escape(string)
elif re_type == 'posix_basic':
@ -299,9 +299,9 @@ def to_uuid(string, namespace=UUID_NAMESPACE_ANSIBLE):
def mandatory(a, msg=None):
"""Make a variable mandatory."""
from jinja2.runtime import Undefined
''' Make a variable mandatory '''
if isinstance(a, Undefined):
if a._undefined_name is not None:
name = "'%s' " % to_text(a._undefined_name)

Loading…
Cancel
Save