Added timeout flag to ovs-vsctl to avoid infinte waiting
Fixes bug 890180 Change-Id: Iba76359d5ee4f625b6a7007b318cf0eb5f1119da
This commit is contained in:
parent
9bab0960b6
commit
a9a39684d7
@ -24,6 +24,7 @@ import MySQLdb
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
import signal
|
||||||
|
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
from subprocess import *
|
from subprocess import *
|
||||||
@ -51,10 +52,14 @@ class OVSBridge:
|
|||||||
|
|
||||||
def run_cmd(self, args):
|
def run_cmd(self, args):
|
||||||
# LOG.debug("## running command: " + " ".join(args))
|
# LOG.debug("## running command: " + " ".join(args))
|
||||||
return Popen(args, stdout=PIPE).communicate()[0]
|
p = Popen(args, stdout=PIPE)
|
||||||
|
retval = p.communicate()[0]
|
||||||
|
if p.returncode == -(signal.SIGALRM):
|
||||||
|
LOG.debug("## timeout running command: " + " ".join(args))
|
||||||
|
return retval
|
||||||
|
|
||||||
def run_vsctl(self, args):
|
def run_vsctl(self, args):
|
||||||
full_args = ["ovs-vsctl"] + args
|
full_args = ["ovs-vsctl", "--timeout=2"] + args
|
||||||
return self.run_cmd(full_args)
|
return self.run_cmd(full_args)
|
||||||
|
|
||||||
def reset_bridge(self):
|
def reset_bridge(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user