From 7775672b0dfc22c93c0624f9827214df9afd61ac Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Sun, 15 Dec 2024 03:19:22 +0800 Subject: [PATCH] Fix typos Found via `typos --hidden --format brief` --- README.md | 4 ++-- esctl/cmd/cat.py | 2 +- esctl/cmd/cluster.py | 2 +- esctl/cmd/task.py | 4 ++-- esctl/commands.py | 2 +- esctl/config.py | 4 ++-- esctl/formatter.py | 22 +++++++++++----------- esctl/interactive.py | 2 +- esctl/main.py | 8 ++++---- 9 files changed, 25 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index ee8cd43..961533c 100644 --- a/README.md +++ b/README.md @@ -53,8 +53,8 @@ esctl cluster routing allocation enable none ## Key Features * **Easy to use CLI** rather than long curl commands (thanks to [cliff](https://github.com/openstack/cliff)) -* Cluster-level informations : **stats**, **info**, **health**, **allocation explanation** -* Node-level informations : **list**, **hot threads**, **exclusion**, **stats** +* Cluster-level information : **stats**, **info**, **health**, **allocation explanation** +* Node-level information : **list**, **hot threads**, **exclusion**, **stats** * Cluster-level and index-level **settings** * `_cat` API for **allocation**, **plugins** and **thread pools** * **Index management** : open, close, create, delete, list diff --git a/esctl/cmd/cat.py b/esctl/cmd/cat.py index cd7c9fe..261a6fd 100644 --- a/esctl/cmd/cat.py +++ b/esctl/cmd/cat.py @@ -49,7 +49,7 @@ def transform(self, allocation): class CatPlugins(EsctlLister): - """Returns informations about installed plugins across nodes.""" + """Returns information about installed plugins across nodes.""" def take_action(self, parsed_args): plugins = self.transform(self.es.cat.plugins(format="json")) diff --git a/esctl/cmd/cluster.py b/esctl/cmd/cluster.py index 1dc2254..c892c63 100644 --- a/esctl/cmd/cluster.py +++ b/esctl/cmd/cluster.py @@ -53,7 +53,7 @@ def take_action(self, parsed_args): class ClusterInfo(EsctlShowOne): - """Show basic informations about the cluster.""" + """Show basic information about the cluster.""" def take_action(self, parsed_args): infos = self.es.info() diff --git a/esctl/cmd/task.py b/esctl/cmd/task.py index 81ffd2b..07bf593 100644 --- a/esctl/cmd/task.py +++ b/esctl/cmd/task.py @@ -32,12 +32,12 @@ def take_action(self, parsed_args): ) def convert_timestamp_in_ms_to_human_readable(self, time_in_ms: int) -> str: - miliseconds = str(round((time_in_ms / 1000) % 1, 3)).split(".")[1] + milliseconds = str(round((time_in_ms / 1000) % 1, 3)).split(".")[1] return ( datetime.datetime.utcfromtimestamp(time_in_ms / 1000).strftime( "%Y-%m-%d %H:%M:%S" ) - + f".{miliseconds}" + + f".{milliseconds}" ) def transform(self, nodes): diff --git a/esctl/commands.py b/esctl/commands.py index b37e4f4..a6f3d5b 100644 --- a/esctl/commands.py +++ b/esctl/commands.py @@ -70,7 +70,7 @@ def objects_list_to_flat_dict(self, lst: list[dict[str, Any]]) -> dict[str, Any] def _delete_and_merge_inner_dict_into_parent( self, parent_dict: dict[str, Any], key: str ) -> dict[str, Any]: - """Merge a inner dictionnary into it's parent. + """Merge a inner dictionary into it's parent. :Example: { diff --git a/esctl/config.py b/esctl/config.py index 306d0c7..bacce66 100644 --- a/esctl/config.py +++ b/esctl/config.py @@ -193,7 +193,7 @@ def load_configuration(self, path: str = "~/.esctlrc") -> OrderedDict: return raw_config_file - def get_context_informations(self, context_name: str): + def get_context_information(self, context_name: str): raw_context = self.contexts.get(context_name) user = self.users.get(raw_context.get("user")) cluster = self.clusters.get(raw_context.get("cluster")) @@ -240,7 +240,7 @@ def create_context(self, context_name: str = None) -> Context: self.log.debug("No context provided. Using default context") try: - context = self.get_context_informations(context_name) + context = self.get_context_information(context_name) self.log.debug(context) except AttributeError: self.log.fatal(f"Cannot load context '{context_name}'.") diff --git a/esctl/formatter.py b/esctl/formatter.py index d39e9dd..2580335 100644 --- a/esctl/formatter.py +++ b/esctl/formatter.py @@ -23,36 +23,36 @@ def _format_special_word(self, word: str) -> str: return word def _split_string(self, string: str) -> list[str]: - splitted_string: list[str] + split_string: list[str] if "." in string: - splitted_string = string.split(".") + split_string = string.split(".") - # Check if words can also be splitted on underscores - for idx in range(len(splitted_string)): + # Check if words can also be split on underscores + for idx in range(len(split_string)): # If there is an underscore anywhere in the word except at the beginning - if "_" in splitted_string[idx] and not splitted_string[idx].startswith( + if "_" in split_string[idx] and not split_string[idx].startswith( "_" ): - splitted_string[idx] = splitted_string[idx].split("_") + split_string[idx] = split_string[idx].split("_") flat_list = [] - for sublist in splitted_string: + for sublist in split_string: if sublist.__class__.__name__ == "list": for item in sublist: flat_list.append(item) else: flat_list.append(sublist) - splitted_string = flat_list + split_string = flat_list elif "_" in string: - splitted_string = string.split("_") + split_string = string.split("_") else: - splitted_string = [string] + split_string = [string] - return splitted_string + return split_string def _create_name_from_id(self, pretty_key=True): """Extrapolate the column's name based on its ID.""" diff --git a/esctl/interactive.py b/esctl/interactive.py index ec28b4f..7ec0af0 100644 --- a/esctl/interactive.py +++ b/esctl/interactive.py @@ -91,7 +91,7 @@ def default(self, line): ret = self.parent_app.run_subcommand(line_parts) if self.errexit: # Only provide this if errexit is enabled, - # otherise keep old behaviour + # otherwise keep old behaviour return ret def completenames(self, text, line, begidx, endidx): diff --git a/esctl/main.py b/esctl/main.py index 54a14ed..cfed385 100644 --- a/esctl/main.py +++ b/esctl/main.py @@ -106,13 +106,13 @@ def configure_logging(self): return def insert_password_into_context(self): - external_passowrd_definition = self.context.user.get("external_password") + external_password_definition = self.context.user.get("external_password") del self.context.user["external_password"] - if "command" in external_passowrd_definition: - if "run" in external_passowrd_definition.get("command"): + if "command" in external_password_definition: + if "run" in external_password_definition.get("command"): self.context.user["password"] = self._run_os_system_command( - external_passowrd_definition.get("command").get("run") + external_password_definition.get("command").get("run") ) def initialize_app(self, argv):