forked from p15670423/monkey
Project: Fix travis build
This commit is contained in:
parent
bd40ca79bf
commit
1bfffb0bfd
|
@ -52,4 +52,3 @@ repos:
|
||||||
rev: v2.3
|
rev: v2.3
|
||||||
hooks:
|
hooks:
|
||||||
- id: vulture
|
- id: vulture
|
||||||
exclude: "monkey/monkey_island/docs/source/conf.py"
|
|
||||||
|
|
|
@ -57,7 +57,6 @@ jobs:
|
||||||
# check python code
|
# check python code
|
||||||
## check syntax errors and fail the build if any are found.
|
## check syntax errors and fail the build if any are found.
|
||||||
- flake8 .
|
- flake8 .
|
||||||
|
|
||||||
## check import order
|
## check import order
|
||||||
- python -m isort ./monkey --check-only
|
- python -m isort ./monkey --check-only
|
||||||
|
|
||||||
|
|
|
@ -8,10 +8,10 @@ from typing import Mapping, Sequence
|
||||||
# might require more complex casting logic
|
# might require more complex casting logic
|
||||||
@dataclass
|
@dataclass
|
||||||
class NetworkMap:
|
class NetworkMap:
|
||||||
nodes: Mapping[str, Sequence[Arc]]
|
nodes: Mapping[str, Sequence[Arc]] # noqa: F821
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Arc:
|
class Arc:
|
||||||
dst_machine: Machine
|
dst_machine: Machine # noqa: F821
|
||||||
status: str
|
status: str
|
||||||
|
|
|
@ -4,10 +4,10 @@ from typing import Optional, Sequence
|
||||||
|
|
||||||
class ILogRepository(ABC):
|
class ILogRepository(ABC):
|
||||||
# Define log object
|
# Define log object
|
||||||
def get_logs(self, agent_id: Optional[str] = None) -> Sequence[Log]:
|
def get_logs(self, agent_id: Optional[str] = None) -> Sequence[Log]: # noqa: F821
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def save_log(self, log: Log):
|
def save_log(self, log: Log): # noqa: F821
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def delete_log(self, agent_id: str):
|
def delete_log(self, agent_id: str):
|
||||||
|
|
|
@ -4,7 +4,7 @@ from typing import Optional, Sequence
|
||||||
|
|
||||||
class IMachineRepository(ABC):
|
class IMachineRepository(ABC):
|
||||||
# TODO define Machine object(ORM model)
|
# TODO define Machine object(ORM model)
|
||||||
def save_machine(self, machine: Machine):
|
def save_machine(self, machine: Machine): # noqa: F821
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# TODO define Machine object(ORM model)
|
# TODO define Machine object(ORM model)
|
||||||
|
@ -14,7 +14,7 @@ class IMachineRepository(ABC):
|
||||||
self,
|
self,
|
||||||
id: Optional[str] = None,
|
id: Optional[str] = None,
|
||||||
ips: Optional[Sequence[str]] = None,
|
ips: Optional[Sequence[str]] = None,
|
||||||
state: Optional[MachineState] = None,
|
state: Optional[MachineState] = None, # noqa: F821
|
||||||
is_island: Optional[bool] = None,
|
is_island: Optional[bool] = None,
|
||||||
) -> Sequence[Machine]:
|
) -> Sequence[Machine]: # noqa: F821
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -4,8 +4,8 @@ from abc import ABC
|
||||||
class INetworkMapRepository(ABC):
|
class INetworkMapRepository(ABC):
|
||||||
|
|
||||||
# TODO Define NetMap object
|
# TODO Define NetMap object
|
||||||
def get_map(self) -> NetMap:
|
def get_map(self) -> NetMap: # noqa: F821
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def save_netmap(self, netmap: NetMap):
|
def save_netmap(self, netmap: NetMap): # noqa: F821
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -4,7 +4,7 @@ from abc import ABC
|
||||||
class ISimulationRepository(ABC):
|
class ISimulationRepository(ABC):
|
||||||
# TODO define simulation object. It should contain metadata about simulation,
|
# TODO define simulation object. It should contain metadata about simulation,
|
||||||
# like start, end times, mode and last forced stop of all monkeys
|
# like start, end times, mode and last forced stop of all monkeys
|
||||||
def save_simulation(self, simulation: Simulation):
|
def save_simulation(self, simulation: Simulation): # noqa: F821
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def get_simulation(self):
|
def get_simulation(self):
|
||||||
|
|
|
@ -14,7 +14,7 @@ class ITelemetryRepository(ABC):
|
||||||
def get_telemetries(
|
def get_telemetries(
|
||||||
self,
|
self,
|
||||||
id: Optional[str] = None,
|
id: Optional[str] = None,
|
||||||
type: Optional[TelemetryType] = None,
|
type: Optional[TelemetryType] = None, # noqa: F821
|
||||||
monkey_id: Optional[str] = None,
|
monkey_id: Optional[str] = None,
|
||||||
) -> Sequence[Telemetry]:
|
) -> Sequence[Telemetry]:
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -15,6 +15,7 @@ MAX_SAME_CATEGORY_TELEMS = 10000
|
||||||
logging.basicConfig(level=logging.INFO)
|
logging.basicConfig(level=logging.INFO)
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
# TODO this will break with the IRepository implementation. Remove it
|
# TODO this will break with the IRepository implementation. Remove it
|
||||||
class TestTelemStore:
|
class TestTelemStore:
|
||||||
TELEMS_EXPORTED = False
|
TELEMS_EXPORTED = False
|
||||||
|
|
|
@ -25,5 +25,5 @@ norecursedirs = "node_modules dist"
|
||||||
markers = ["slow: mark test as slow"]
|
markers = ["slow: mark test as slow"]
|
||||||
|
|
||||||
[tool.vulture]
|
[tool.vulture]
|
||||||
exclude = ["monkey/monkey_island/cc/ui/", "monkey/tests/"]
|
exclude = ["monkey/monkey_island/cc/ui/", "monkey/tests/", "monkey/monkey_island/docs/"]
|
||||||
paths = ["."]
|
paths = ["."]
|
||||||
|
|
Loading…
Reference in New Issue