mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-30 04:49:09 -07:00
Enable more pylint rules and fix reported issues. (#30539)
* Enable pylint unreachable test. * Enable pylint suppressed-message test. * Enable pylint redundant-unittest-assert test. * Enable pylint bad-open-mode test. * Enable pylint signature-differs test. * Enable pylint unnecessary-pass test. * Enable pylint unnecessary-lambda test. * Enable pylint raising-bad-type test. * Enable pylint logging-not-lazy test. * Enable pylint logging-format-interpolation test. * Enable pylint useless-else-on-loop test.
This commit is contained in:
parent
01563ccd5d
commit
7714dcd04e
36 changed files with 92 additions and 135 deletions
|
@ -668,8 +668,7 @@ class LxcContainerManagement(object):
|
|||
build_command.append(
|
||||
'%s %s' % (key, value)
|
||||
)
|
||||
else:
|
||||
return build_command
|
||||
return build_command
|
||||
|
||||
def _get_vars(self, variables):
|
||||
"""Return a dict of all variables as found within the module.
|
||||
|
@ -689,8 +688,7 @@ class LxcContainerManagement(object):
|
|||
_var = self.module.params.get(k)
|
||||
if _var not in false_values:
|
||||
return_dict[v] = _var
|
||||
else:
|
||||
return return_dict
|
||||
return return_dict
|
||||
|
||||
def _run_command(self, build_command, unsafe_shell=False):
|
||||
"""Return information from running an Ansible Command.
|
||||
|
@ -975,16 +973,15 @@ class LxcContainerManagement(object):
|
|||
time.sleep(1)
|
||||
else:
|
||||
return True
|
||||
else:
|
||||
self.failure(
|
||||
lxc_container=self._container_data(),
|
||||
error='Failed to start container'
|
||||
' [ %s ]' % self.container_name,
|
||||
rc=1,
|
||||
msg='The container [ %s ] failed to start. Check to lxc is'
|
||||
' available and that the container is in a functional'
|
||||
' state.' % self.container_name
|
||||
)
|
||||
self.failure(
|
||||
lxc_container=self._container_data(),
|
||||
error='Failed to start container'
|
||||
' [ %s ]' % self.container_name,
|
||||
rc=1,
|
||||
msg='The container [ %s ] failed to start. Check to lxc is'
|
||||
' available and that the container is in a functional'
|
||||
' state.' % self.container_name
|
||||
)
|
||||
|
||||
def _check_archive(self):
|
||||
"""Create a compressed archive of a container.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue