Commit 07957f98 authored by Jonas Kaufmann's avatar Jonas Kaufmann Committed by Antoine Kaufmann
Browse files

some fixes for pytype errors

parent 1971c11e
......@@ -21,6 +21,7 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import asyncio
from asyncio.subprocess import Process
import os
import pathlib
import re
......@@ -38,6 +39,9 @@ class HostConfig(object):
self.other = other.copy()
class Component(object):
proc: Process
terminate_future: asyncio.Task[int]
def __init__(self, cmd_parts, with_stdin=False):
self.is_ready = False
self.stdout = []
......
......@@ -138,8 +138,10 @@ class DistributedExperiment(Experiment):
return True
class ExperimentBaseRunner(object):
def __init__(self, exp: Experiment, env: ExpEnv, verbose: bool):
T = tp.TypeVar('T', bound=Experiment)
class ExperimentBaseRunner(tp.Generic[T]):
def __init__(self, exp: T, env: ExpEnv, verbose: bool):
self.exp = exp
self.env = env
self.verbose = verbose
......@@ -304,7 +306,7 @@ class ExperimentBaseRunner(object):
return self.out
class ExperimentSimpleRunner(ExperimentBaseRunner):
class ExperimentSimpleRunner(ExperimentBaseRunner[Experiment]):
""" Simple experiment runner with just one executor. """
def __init__(self, exec: Executor, *args, **kwargs):
self.exec = exec
......@@ -314,7 +316,7 @@ class ExperimentSimpleRunner(ExperimentBaseRunner):
return self.exec
class ExperimentDistributedRunner(ExperimentBaseRunner):
class ExperimentDistributedRunner(ExperimentBaseRunner[DistributedExperiment]):
""" Simple experiment runner with just one executor. """
def __init__(self, execs, *args, **kwargs):
self.execs = execs
......
......@@ -533,6 +533,7 @@ class HTTPD(AppConfig):
threads = 1
file_size = 64
mtcp_config = 'lighttpd.conf'
httpd_dir: str # TODO added because doesn't originally exist
def prepare_pre_cp(self):
return ['mkdir -p /srv/www/htdocs/ /tmp/lighttpd/',
......@@ -569,6 +570,7 @@ class HTTPC(AppConfig):
requests = 10000
threads = 1
url = '/file'
ab_dir: str # TODO added because doesn't originally exist
def run_cmds(self, node):
return ['cd %s/support/' % (self.ab_dir),
......
......@@ -41,6 +41,10 @@ class Simulator(object):
"""Memory required for this simulator (in MB)."""
return 64
def full_name(self):
"""Full name of the simulator."""
return ''
def prep_cmds(self, env: ExpEnv) -> tp.List[str]:
"""Commands to run to prepare simulator."""
return []
......@@ -416,6 +420,8 @@ class MultiSubNIC(NICSim):
return 0
class I40eMultiNIC(Simulator):
name = ''
def __init__(self):
self.subnics = []
super().__init__()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment