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

Fix netmaster starting script in tesing codes #1064

Merged
merged 1 commit into from
Nov 14, 2017
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
3 changes: 2 additions & 1 deletion install/v2plugin/startcontiv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@

set -e

if [ $log_dir == "" ]; then
if [ "$log_dir" == "" ]; then
log_dir="/var/log/contiv"
fi
mkdir -p $log_dir
BOOTUP_LOGFILE="$log_dir/plugin_bootup.log"

# Redirect stdout and stdin to BOOTUP_LOGFILE
Expand Down
9 changes: 5 additions & 4 deletions scripts/python/api/tnode.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def createV2Plugin(self, args=""):
# Enable v2plugin on vagrant node
def enableV2Plugin(self, role="master", args=""):
ssh_object = self.sshConnect(self.username, self.password)
command = "docker plugin set " + os.environ.get("CONTIV_V2PLUGIN_NAME", "contiv/v2plugin:0.0") + " ctrl_ip="+ self.addr + " control_url=" + self.addr + ":9999 vxlan_port=8472 iflist=eth2,eth3 plugin_name=" + os.environ.get("CONTIV_V2PLUGIN_NAME","contiv/v2plugin:0.0") + args + " >> /tmp/netplugin.log 2>&1"
fwd_mode = os.environ.get("CONTIV_V2PLUGIN_FWDMODE", "bridge")
command = "docker plugin set " + os.environ.get("CONTIV_V2PLUGIN_NAME", "contiv/v2plugin:0.0") + " ctrl_ip="+ self.addr + " control_url=" + self.addr + ":9999 vxlan_port=8472 iflist=eth2,eth3 plugin_name=" + os.environ.get("CONTIV_V2PLUGIN_NAME","contiv/v2plugin:0.0") + " fwd_mode=" + fwd_mode + " " + args + " >> /tmp/netplugin.log 2>&1"
self.runCmd(command)
command = "docker plugin enable " + os.environ.get("CONTIV_V2PLUGIN_NAME", "contiv/v2plugin:0.0") + args + " >> /tmp/netplugin.log 2>&1"
self.npThread = threading.Thread(target=ssh_exec_thread, args=(ssh_object, command))
Expand Down Expand Up @@ -107,13 +108,13 @@ def startNetmaster(self):
# npThread.setDaemon(True)
self.nmThread.start()

# Execute command in a thread
# Execute command in a thread
def runCmdThread(self, command):
ssh_object = self.sshConnect(self.username, self.password)
self.swThread = threading.Thread(target=ssh_exec_thread, args=(ssh_object, command))
self.swThread.start()
# Stop v2plugin by force rm

# Stop v2plugin by force rm
def stopV2Plugin(self, args=""):
command = "docker plugin disable " + os.environ.get("CONTIV_V2PLUGIN_NAME", "contiv/v2plugin:0.0") + "> /tmp/netplugin.log 2>&1"
command = "docker plugin rm -f " + os.environ.get("CONTIV_V2PLUGIN_NAME", "contiv/v2plugin:0.0") + "> /tmp/netplugin.log 2>&1"
Expand Down