mirror of
https://github.com/ansible-collections/community.crypto.git
synced 2026-05-07 05:43:06 +00:00
Use ruff format, and then undo most changes with black and isort. (#903)
This commit is contained in:
@@ -52,7 +52,6 @@ if t.TYPE_CHECKING:
|
||||
|
||||
|
||||
class KeypairBackend(OpensshModule, metaclass=abc.ABCMeta):
|
||||
|
||||
def __init__(self, *, module: AnsibleModule) -> None:
|
||||
super().__init__(module=module)
|
||||
|
||||
@@ -567,8 +566,7 @@ def select_backend(
|
||||
else:
|
||||
module.fail_json(
|
||||
msg=(
|
||||
"Cannot find either the OpenSSH binary in the PATH "
|
||||
f"or cryptography >= {COLLECTION_MINIMUM_CRYPTOGRAPHY_VERSION} installed on this system"
|
||||
f"Cannot find either the OpenSSH binary in the PATH or cryptography >= {COLLECTION_MINIMUM_CRYPTOGRAPHY_VERSION} installed on this system"
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -779,8 +779,7 @@ def get_option_type(name: str) -> t.Literal["critical", "extension"]:
|
||||
if name in _EXTENSIONS:
|
||||
return "extension"
|
||||
raise ValueError(
|
||||
f"{name} is not a valid option. "
|
||||
"Custom options must start with 'critical:' or 'extension:' to indicate type"
|
||||
f"{name} is not a valid option. Custom options must start with 'critical:' or 'extension:' to indicate type"
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -370,7 +370,8 @@ class AsymmetricKeypair:
|
||||
|
||||
try:
|
||||
return self.__privatekey.sign(
|
||||
data, **_ALGORITHM_PARAMETERS[self.__keytype]["signer_params"] # type: ignore
|
||||
data,
|
||||
**_ALGORITHM_PARAMETERS[self.__keytype]["signer_params"], # type: ignore
|
||||
)
|
||||
except TypeError as e:
|
||||
raise InvalidDataError(e) from e
|
||||
@@ -788,7 +789,6 @@ def validate_comment(comment: str) -> None:
|
||||
|
||||
|
||||
def extract_comment(path: str | os.PathLike) -> str:
|
||||
|
||||
if not os.path.exists(path):
|
||||
raise InvalidPublicKeyFileError(f"No file was found at {path}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user