mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-20 02:39:02 +00:00
fix ruff case UP031 (#11223)
* fix ruff case UP031 * refactor backslashout of f-string for the sake of old Pythons * add changelog frag * Update plugins/modules/imc_rest.py Co-authored-by: Felix Fontein <felix@fontein.de> * scaleway_user_data: fix bug and make it an f-string * reformat --------- Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
1ab9be152f
commit
d550baacfa
22 changed files with 72 additions and 63 deletions
|
|
@ -9,7 +9,6 @@ from ansible.errors import (
|
|||
AnsibleFilterError,
|
||||
)
|
||||
|
||||
from ansible.module_utils.common.text.converters import to_native
|
||||
from ansible.module_utils.common.collections import is_sequence
|
||||
|
||||
try:
|
||||
|
|
@ -34,10 +33,8 @@ def initialize_hashids(**kwargs):
|
|||
try:
|
||||
return Hashids(**params)
|
||||
except TypeError as e:
|
||||
raise AnsibleFilterError(
|
||||
"The provided parameters %s are invalid: %s"
|
||||
% (", ".join(["%s=%s" % (k, v) for k, v in params.items()]), to_native(e))
|
||||
) from e
|
||||
str_params = ", ".join([f"{k}={v}" for k, v in params.items()])
|
||||
raise AnsibleFilterError(f"The provided parameters {str_params} are invalid: {e}") from e
|
||||
|
||||
|
||||
def hashids_encode(nums, salt=None, alphabet=None, min_length=None):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue