...
 
Commits (2)
......@@ -26,7 +26,7 @@ import ssh_helper
DEFAULT_CLONE_PATH="~/sniffer/"
DEFAULT_CONTROLLER='core0'
DEFAULT_CONTROLLER_PORT = 11000
DEFAULT_CONTROLLER_PORT = 8080 # While this could theoretically be any port, the SDN controller does not accept it as a parameter...
DEFAULT_EXECUTABLE='main.py'
DEFAULT_LOGFILE="/tmp/sniffer.log"
DEFAULT_PIDFILE="/tmp/sniffer.pid"
......@@ -35,7 +35,11 @@ DEFAULT_REPO_URL="https://gitlab.flux.utah.edu/safeedge/ospfv3_monitor.git"
def _generate_repo_clone_command(repo: str, branch: str, path: str) -> str:
return "git clone -b {branch} --single-branch -- {repo} {path}".format(repo=repo, branch=branch, path=path)
return "git clone -b {branch} --single-branch -- {repo} {path};" \
"pushd {path};" \
"virtualenv -p /usr/bin/python2 env && env/bin/activate;" \
"pip install -r requirements.txt;" \
"popd;".format(repo=repo, branch=branch, path=path)
def _generate_repo_update_command(path: str) -> str:
......@@ -62,7 +66,7 @@ def _generate_start_command(path:str=DEFAULT_CLONE_PATH,
:param pidfile: File to which the PID will be written
:return:
"""
return "sudo {path}/{executable} --controller={controller} --port={port} 1> {logfile} & echo $! > {pidfile} && disown".format(
return "{path}/python-sudo.sh {path}/{executable} --controller={controller} --port={port} 1> {logfile} & echo $! > {pidfile} && disown".format(
path=path,
executable=executable,
controller=controller,
......