Skip to content

Commit

Permalink
Remove unneccessary imports (#569)
Browse files Browse the repository at this point in the history
* Remove unneccessary imports.

* Add noqas.

* Add comment which name is actually ignored.
  • Loading branch information
felixfontein committed Feb 9, 2023
1 parent 7f04001 commit aea3713
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/remove-unneeded-imports.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- "various plugins - remove unnecessary imports (https://github.com/ansible-collections/community.crypto/pull/569)."
2 changes: 1 addition & 1 deletion plugins/filter/x509_crl_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@

from ansible.errors import AnsibleFilterError
from ansible.module_utils.six import string_types
from ansible.module_utils.common.text.converters import to_bytes, to_native, to_text
from ansible.module_utils.common.text.converters import to_bytes, to_native

from ansible_collections.community.crypto.plugins.module_utils.crypto.basic import (
OpenSSLObjectError,
Expand Down
2 changes: 1 addition & 1 deletion plugins/module_utils/acme/acme.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
)

try:
import ipaddress
import ipaddress # noqa: F401, pylint: disable=unused-import
except ImportError:
HAS_IPADDRESS = False
IPADDRESS_IMPORT_ERROR = traceback.format_exc()
Expand Down
2 changes: 1 addition & 1 deletion plugins/module_utils/crypto/openssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
__metaclass__ = type

# This import is only to maintain backwards compatibility
from ansible_collections.community.crypto.plugins.module_utils.openssh.utils import (
from ansible_collections.community.crypto.plugins.module_utils.openssh.utils import ( # noqa: F401, pylint: disable=unused-import
parse_openssh_version
)
2 changes: 1 addition & 1 deletion plugins/module_utils/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
#
# from ansible.module_utils.compat.version import LooseVersion

from ._version import LooseVersion
from ._version import LooseVersion # noqa: F401, pylint: disable=unused-import
4 changes: 2 additions & 2 deletions plugins/plugin_utils/action_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@
# For ansible-core 2.11, we can use the ArgumentSpecValidator. We also import
# ModuleArgumentSpecValidator since that indicates that the 'classical' approach
# will no longer work.
from ansible.module_utils.common.arg_spec import (
from ansible.module_utils.common.arg_spec import ( # noqa: F401, pylint: disable=unused-import
ArgumentSpecValidator,
ModuleArgumentSpecValidator, # noqa
ModuleArgumentSpecValidator, # ModuleArgumentSpecValidator is not used
)
from ansible.module_utils.errors import UnsupportedError
HAS_ARGSPEC_VALIDATOR = True
Expand Down

0 comments on commit aea3713

Please sign in to comment.