mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
remove pylint exceptions (#6927)
* remove pylint exceptions * add changelog frag
This commit is contained in:
parent
cc8e2d676a
commit
4b382ed1df
4 changed files with 9 additions and 13 deletions
3
changelogs/fragments/6927-pylint-comments.yml
Normal file
3
changelogs/fragments/6927-pylint-comments.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
minor_changes:
|
||||
- gitlab_runner - minor refactor removing unnecessary code statements (https://github.com/ansible-collections/community.general/pull/6927).
|
||||
- keyring - minor refactor removing unnecessary code statements (https://github.com/ansible-collections/community.general/pull/6927).
|
|
@ -100,9 +100,9 @@ except ImportError:
|
|||
from ansible.module_utils.common import respawn
|
||||
from ansible.module_utils.six.moves.urllib.error import HTTPError
|
||||
from ansible.module_utils.basic import missing_required_lib
|
||||
from ansible.module_utils import distro # pylint: disable=import-error
|
||||
from ansible.module_utils.basic import AnsibleModule # pylint: disable=import-error
|
||||
from ansible.module_utils.urls import open_url # pylint: disable=import-error
|
||||
from ansible.module_utils import distro
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.urls import open_url
|
||||
|
||||
|
||||
def _respawn_dnf():
|
||||
|
|
|
@ -210,13 +210,6 @@ from ansible_collections.community.general.plugins.module_utils.gitlab import (
|
|||
)
|
||||
|
||||
|
||||
try:
|
||||
cmp # pylint: disable=used-before-assignment
|
||||
except NameError:
|
||||
def cmp(a, b):
|
||||
return (a > b) - (a < b)
|
||||
|
||||
|
||||
class GitLabRunner(object):
|
||||
def __init__(self, module, gitlab_instance, group=None, project=None):
|
||||
self._module = module
|
||||
|
@ -302,7 +295,7 @@ class GitLabRunner(object):
|
|||
list1.sort()
|
||||
list2 = arguments[arg_key]
|
||||
list2.sort()
|
||||
if cmp(list1, list2):
|
||||
if list1 != list2:
|
||||
setattr(runner, arg_key, arguments[arg_key])
|
||||
changed = True
|
||||
else:
|
||||
|
|
|
@ -106,7 +106,7 @@ def del_passphrase(module):
|
|||
try:
|
||||
keyring.delete_password(module.params["service"], module.params["username"])
|
||||
return None
|
||||
except keyring.errors.KeyringLocked as keyring_locked_err: # pylint: disable=unused-variable
|
||||
except keyring.errors.KeyringLocked:
|
||||
delete_argument = (
|
||||
'echo "%s" | gnome-keyring-daemon --unlock\nkeyring del %s %s\n'
|
||||
% (
|
||||
|
@ -140,7 +140,7 @@ def set_passphrase(module):
|
|||
module.params["user_password"],
|
||||
)
|
||||
return None
|
||||
except keyring.errors.KeyringLocked as keyring_locked_err: # pylint: disable=unused-variable
|
||||
except keyring.errors.KeyringLocked:
|
||||
set_argument = (
|
||||
'echo "%s" | gnome-keyring-daemon --unlock\nkeyring set %s %s\n%s\n'
|
||||
% (
|
||||
|
|
Loading…
Reference in a new issue