Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mypy errors fixed #227

Merged
merged 1 commit into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def to_dict(self) -> Dict[str, Any]:
:return: a dict representation of the object
"""
d = {}
d: Dict[str, Any] = {}
d["ttl"] = self.ttl
d["ipaddr"] = self.ipaddr
d["rtt"] = self.rtt
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Dict, Any
from typing import Dict, Any, Union
from csle_base.json_serializable import JSONSerializable


Expand Down Expand Up @@ -42,13 +42,13 @@ def get_best_match(os_matches):
best_os = os
return best_os

def to_dict(self) -> Dict[str, Any]:
def to_dict(self) -> Dict[str, Union[str, int]]:
"""
Converts the object to a dict representation

:return: a dict representation of the object
"""
d = {}
d: Dict[str, Union[str, int]] = {}
d["name"] = self.name
d["vendor"] = self.vendor
d["osfamily"] = self.osfamily
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["client_managers_running"] = self.client_managers_running
d["ips"] = self.ips
d["ports"] = self.ports
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Dict, Any
from typing import Dict, Any, Union
from csle_base.json_serializable import JSONSerializable


Expand All @@ -23,13 +23,13 @@ def __init__(self, ip: str, leader: bool, cpus: int, gpus: int, RAM: int):
self.gpus = gpus
self.RAM = RAM

def to_dict(self) -> Dict[str, Any]:
def to_dict(self) -> Dict[str, Union[str, bool, int]]:
"""
Converts the object to a dict representation

:return: a dict representation of the object
"""
d = {}
d: Dict[str, Union[str, bool, int]] = {}
d["ip"] = self.ip
d["leader"] = self.leader
d["cpus"] = self.cpus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def to_dict(self) -> Dict[str, Any]:
:return: a dict representation of the object
"""
d = {}
d: Dict[str, Any] = {}
d["docker_stats_managers_running"] = self.docker_stats_managers_running
d["ips"] = self.ips
d["emulation_name"] = self.emulation_name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def to_dict(self) -> Dict[str, Any]:
:return: a dict representation of the object
"""
d = {}
d: Dict[str, Any] = {}
d["elk_managers_running"] = self.elk_managers_running
d["ips"] = self.ips
d["ports"] = self.ports
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Dict, Any
from typing import Dict, Any, Union
from csle_base.json_serializable import JSONSerializable


Expand Down Expand Up @@ -47,13 +47,13 @@ def from_dict(d: Dict[str, Any]) -> "Flag":
)
return obj

def to_dict(self) -> Dict[str, Any]:
def to_dict(self) -> Dict[str, Union[str, int, bool]]:
"""
Converts the object to a dict representation

:return: a dict representation of the object
"""
d = {}
d: Dict[str, Union[str, int, bool]] = {}
d["name"] = self.name
d["dir"] = self.dir
d["id"] = self.id
Expand Down
Loading