Skip to content

Commit

Permalink
Merge pull request #223 from Limmen/dev
Browse files Browse the repository at this point in the history
fixed several to_dict-functions
  • Loading branch information
Limmen authored Aug 17, 2023
2 parents 692f550 + 40f770c commit 0fdcbba
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def to_dict(self) -> Dict[str, Any]:
:return: a dict representation of the object
"""
d = {}
d: Dict[str, Any] = {}
d["node_beats_configs"] = list(map(lambda x: x.to_dict(), self.node_beats_configs))
d["num_elastic_shards"] = self.num_elastic_shards
d["reload_enabled"] = self.reload_enabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def to_dict(self) -> Dict[str, Any]:
:return: a dict representation of the object
"""
d = {}
d: Dict[str, Any] = {}
d["management_admin_username_default"] = self.management_admin_username_default
d["management_admin_password_default"] = self.management_admin_password_default
d[
Expand Down Expand Up @@ -249,7 +249,7 @@ def to_param_dict(self) -> Dict[str, Any]:
"""
:return: a param-dict representation of the object
"""
d = {}
d: Dict[str, Any] = {}
d["parameters"] = []
d["parameters"].append(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def to_dict(self) -> Dict[str, Any]:
:return: a dict representation of the object
"""
d = {}
d: Dict[str, Any] = {}
d["ip"] = self.ip
d["default_gw"] = self.default_gw
d["default_input"] = self.default_input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def get_flags_for_ips(self, ips: List[str]) -> List[Flag]:
:param ips: the list of ip addresses to get flags for
:return: the list of flags
"""
flags = []
flags: List[Flag] = []
for node_flag_config in self.node_flag_configs:
if node_flag_config.ip in ips:
flags = flags + node_flag_config.flags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def get_root_usernames(self, ips: List[str]) -> List[str]:
:param ips: the list of ips to get the root usernames for
:return: the list of root usernames
"""
root_usernames = []
root_usernames: List[str] = []
for users_config in self.users_configs:
if users_config.ip in ips:
root_usernames = root_usernames + users_config.users
Expand Down

0 comments on commit 0fdcbba

Please sign in to comment.