Skip to content

Commit

Permalink
remove pylint exceptions (#6927)
Browse files Browse the repository at this point in the history
* remove pylint exceptions

* add changelog frag
  • Loading branch information
russoz authored Jul 14, 2023
1 parent cc8e2d6 commit 4b382ed
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/6927-pylint-comments.yml
Original file line number Diff line number Diff line change
@@ -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).
6 changes: 3 additions & 3 deletions plugins/modules/copr.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@
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():
Expand Down
9 changes: 1 addition & 8 deletions plugins/modules/gitlab_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,6 @@
)


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
Expand Down Expand Up @@ -302,7 +295,7 @@ def update_runner(self, runner, arguments):
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:
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/keyring.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
% (
Expand Down Expand Up @@ -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'
% (
Expand Down

0 comments on commit 4b382ed

Please sign in to comment.