mirror of
https://github.com/ansible-collections/community.crypto.git
synced 2026-05-08 06:13:03 +00:00
Work on issues found by pylint (#896)
* Look at possibly-used-before-assignment. * Use latest beta releases of ansible-core 2.19 for mypy and pylint. * Look at unsupported-*. * Look at unknown-option-value. * Look at redefined-builtin. * Look at superfluous-parens. * Look at unspecified-encoding. * Adjust to new cryptography version and to ansible-core 2.17's pylint. * Look at super-with-arguments. * Look at no-else-*. * Look at try-except-raise. * Look at inconsistent-return-statements. * Look at redefined-outer-name. * Look at redefined-argument-from-local. * Look at attribute-defined-outside-init. * Look at unused-variable. * Look at protected-access. * Look at raise-missing-from. * Look at arguments-differ. * Look at useless-suppression and use-symbolic-message-instead. * Look at consider-using-dict-items. * Look at consider-using-in. * Look at consider-using-set-comprehension. * Look at consider-using-with. * Look at use-dict-literal.
This commit is contained in:
@@ -410,17 +410,21 @@ from ansible_collections.community.crypto.plugins.module_utils._time import (
|
||||
|
||||
def main() -> t.NoReturn:
|
||||
module = AnsibleModule(
|
||||
argument_spec=dict(
|
||||
path=dict(type="path"),
|
||||
content=dict(type="str"),
|
||||
valid_at=dict(type="dict"),
|
||||
name_encoding=dict(
|
||||
type="str", default="ignore", choices=["ignore", "idna", "unicode"]
|
||||
),
|
||||
select_crypto_backend=dict(
|
||||
type="str", default="auto", choices=["auto", "cryptography"]
|
||||
),
|
||||
),
|
||||
argument_spec={
|
||||
"path": {"type": "path"},
|
||||
"content": {"type": "str"},
|
||||
"valid_at": {"type": "dict"},
|
||||
"name_encoding": {
|
||||
"type": "str",
|
||||
"default": "ignore",
|
||||
"choices": ["ignore", "idna", "unicode"],
|
||||
},
|
||||
"select_crypto_backend": {
|
||||
"type": "str",
|
||||
"default": "auto",
|
||||
"choices": ["auto", "cryptography"],
|
||||
},
|
||||
},
|
||||
required_one_of=(["path", "content"],),
|
||||
mutually_exclusive=(["path", "content"],),
|
||||
supports_check_mode=True,
|
||||
@@ -460,7 +464,7 @@ def main() -> t.NoReturn:
|
||||
not_before = module_backend.get_not_before()
|
||||
not_after = module_backend.get_not_after()
|
||||
|
||||
result["valid_at"] = dict()
|
||||
result["valid_at"] = {}
|
||||
if valid_at:
|
||||
for k, v in valid_at.items():
|
||||
result["valid_at"][k] = not_before <= v <= not_after
|
||||
|
||||
Reference in New Issue
Block a user