1
0
Fork 0
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:
Alexei Znamensky 2023-07-14 17:03:34 +12:00 committed by GitHub
parent cc8e2d676a
commit 4b382ed1df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 13 deletions

View 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).

View file

@ -100,9 +100,9 @@ except ImportError:
from ansible.module_utils.common import respawn from ansible.module_utils.common import respawn
from ansible.module_utils.six.moves.urllib.error import HTTPError from ansible.module_utils.six.moves.urllib.error import HTTPError
from ansible.module_utils.basic import missing_required_lib from ansible.module_utils.basic import missing_required_lib
from ansible.module_utils import distro # pylint: disable=import-error from ansible.module_utils import distro
from ansible.module_utils.basic import AnsibleModule # pylint: disable=import-error from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import open_url # pylint: disable=import-error from ansible.module_utils.urls import open_url
def _respawn_dnf(): def _respawn_dnf():

View file

@ -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): class GitLabRunner(object):
def __init__(self, module, gitlab_instance, group=None, project=None): def __init__(self, module, gitlab_instance, group=None, project=None):
self._module = module self._module = module
@ -302,7 +295,7 @@ class GitLabRunner(object):
list1.sort() list1.sort()
list2 = arguments[arg_key] list2 = arguments[arg_key]
list2.sort() list2.sort()
if cmp(list1, list2): if list1 != list2:
setattr(runner, arg_key, arguments[arg_key]) setattr(runner, arg_key, arguments[arg_key])
changed = True changed = True
else: else:

View file

@ -106,7 +106,7 @@ def del_passphrase(module):
try: try:
keyring.delete_password(module.params["service"], module.params["username"]) keyring.delete_password(module.params["service"], module.params["username"])
return None return None
except keyring.errors.KeyringLocked as keyring_locked_err: # pylint: disable=unused-variable except keyring.errors.KeyringLocked:
delete_argument = ( delete_argument = (
'echo "%s" | gnome-keyring-daemon --unlock\nkeyring del %s %s\n' 'echo "%s" | gnome-keyring-daemon --unlock\nkeyring del %s %s\n'
% ( % (
@ -140,7 +140,7 @@ def set_passphrase(module):
module.params["user_password"], module.params["user_password"],
) )
return None return None
except keyring.errors.KeyringLocked as keyring_locked_err: # pylint: disable=unused-variable except keyring.errors.KeyringLocked:
set_argument = ( set_argument = (
'echo "%s" | gnome-keyring-daemon --unlock\nkeyring set %s %s\n%s\n' 'echo "%s" | gnome-keyring-daemon --unlock\nkeyring set %s %s\n%s\n'
% ( % (