From 847d470b2ff8938db5255aca247cbda2ac424fa1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 23 Aug 2024 16:01:53 +0000 Subject: [PATCH] chore: auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- plugins/module_utils/controller.py | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/plugins/module_utils/controller.py b/plugins/module_utils/controller.py index 3d239ce5..24c5a4ec 100644 --- a/plugins/module_utils/controller.py +++ b/plugins/module_utils/controller.py @@ -36,7 +36,9 @@ def get_name_field_from_endpoint(endpoint: str) -> str: def get_endpoint(self, endpoint: str, **kwargs: Any) -> Response: return self.client.get(endpoint, **kwargs) - def post_endpoint(self, endpoint: str, **kwargs: Any) -> Union[dict[str, bool], Response]: + def post_endpoint( + self, endpoint: str, **kwargs: Any + ) -> Union[dict[str, bool], Response]: # Handle check mode if self.module.check_mode: self.result["changed"] = True @@ -44,7 +46,9 @@ def post_endpoint(self, endpoint: str, **kwargs: Any) -> Union[dict[str, bool], return self.client.post(endpoint, **kwargs) - def patch_endpoint(self, endpoint: str, **kwargs: Any) -> Union[dict[str, bool], Response]: + def patch_endpoint( + self, endpoint: str, **kwargs: Any + ) -> Union[dict[str, bool], Response]: # Handle check mode if self.module.check_mode: self.result["changed"] = True @@ -52,7 +56,9 @@ def patch_endpoint(self, endpoint: str, **kwargs: Any) -> Union[dict[str, bool], return self.client.patch(endpoint, **kwargs) - def delete_endpoint(self, endpoint: str, **kwargs: Any) -> Union[dict[str, bool], Response]: + def delete_endpoint( + self, endpoint: str, **kwargs: Any + ) -> Union[dict[str, bool], Response]: # Handle check mode if self.module.check_mode: self.result["changed"] = True @@ -75,7 +81,9 @@ def get_item_name(self, item: Any) -> Any: msg = "Cant determine identity field for Undefined object." raise EDAError(msg) - def fail_wanted_one(self, response: list[Any], endpoint: str, query_params: Any) -> NoReturn: + def fail_wanted_one( + self, response: list[Any], endpoint: str, query_params: Any + ) -> NoReturn: url = self.client.build_url(endpoint, query_params) host_length = len(self.client.host) display_endpoint = url.geturl()[ @@ -86,7 +94,9 @@ def fail_wanted_one(self, response: list[Any], endpoint: str, query_params: Any) ) raise EDAError(msg) - def get_exactly_one(self, endpoint:str, name: Optional[str]=None, **kwargs: Any) -> dict[str, Any]: + def get_exactly_one( + self, endpoint: str, name: Optional[str] = None, **kwargs: Any + ) -> dict[str, Any]: new_kwargs = kwargs.copy() result = self.get_one_or_many(endpoint, name=name, **kwargs) @@ -250,7 +260,13 @@ def fields_could_be_same(old_field: Any, new_field: Any) -> bool: return True return bool(new_field == old_field) - def objects_could_be_different(self, old: dict[str, Any], new: dict[str, Any], field_set:Optional[set]=None, warning:bool=False) -> bool: + def objects_could_be_different( + self, + old: dict[str, Any], + new: dict[str, Any], + field_set: Optional[set] = None, + warning: bool = False, + ) -> bool: if field_set is None: field_set = set(fd for fd in new.keys()) for field in field_set: