Migrate "ovs-ofctl" to oslo.privsep
Story: #2007686 Task: #42184 Change-Id: Ifc7ec227d4084331948c42cd99d96ad10c09a6f1
This commit is contained in:
parent
493286511d
commit
becb42b92e
@ -373,7 +373,8 @@ class OVSBridge(BaseOVS):
|
|||||||
for i in range(1, 11):
|
for i in range(1, 11):
|
||||||
try:
|
try:
|
||||||
return utils.execute(full_args, run_as_root=True,
|
return utils.execute(full_args, run_as_root=True,
|
||||||
process_input=process_input)
|
process_input=process_input,
|
||||||
|
privsep_exec=True)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if "failed to connect to socket" in str(e):
|
if "failed to connect to socket" in str(e):
|
||||||
LOG.debug("Failed to connect to OVS. Retrying "
|
LOG.debug("Failed to connect to OVS. Retrying "
|
||||||
|
@ -113,7 +113,8 @@ def ofctl_arg_supported(cmd, **kwargs):
|
|||||||
ovs_lib._build_flow_expr_str(kwargs, cmd.split('-')[0],
|
ovs_lib._build_flow_expr_str(kwargs, cmd.split('-')[0],
|
||||||
False)]
|
False)]
|
||||||
try:
|
try:
|
||||||
agent_utils.execute(full_args, run_as_root=True)
|
agent_utils.execute(full_args, run_as_root=True,
|
||||||
|
privsep_exec=True)
|
||||||
except RuntimeError as e:
|
except RuntimeError as e:
|
||||||
LOG.debug("Exception while checking supported feature via "
|
LOG.debug("Exception while checking supported feature via "
|
||||||
"command %s. Exception: %s", full_args, e)
|
"command %s. Exception: %s", full_args, e)
|
||||||
|
@ -200,12 +200,12 @@ class OVS_Lib_Test(base.BaseTestCase):
|
|||||||
|
|
||||||
def _ofctl_mock(self, cmd, *args, **kwargs):
|
def _ofctl_mock(self, cmd, *args, **kwargs):
|
||||||
cmd = self._ofctl_args(cmd, *args)
|
cmd = self._ofctl_args(cmd, *args)
|
||||||
return mock.call(cmd, run_as_root=True, **kwargs)
|
return mock.call(cmd, run_as_root=True, privsep_exec=True, **kwargs)
|
||||||
|
|
||||||
def _verify_ofctl_mock(self, cmd, *args, **kwargs):
|
def _verify_ofctl_mock(self, cmd, *args, **kwargs):
|
||||||
cmd = self._ofctl_args(cmd, *args)
|
cmd = self._ofctl_args(cmd, *args)
|
||||||
return self.execute.assert_called_once_with(cmd, run_as_root=True,
|
return self.execute.assert_called_once_with(
|
||||||
**kwargs)
|
cmd, run_as_root=True, privsep_exec=True, **kwargs)
|
||||||
|
|
||||||
def test_add_flow_timeout_set(self):
|
def test_add_flow_timeout_set(self):
|
||||||
flow_dict = collections.OrderedDict([
|
flow_dict = collections.OrderedDict([
|
||||||
|
@ -1168,7 +1168,7 @@ class TestCookieContext(base.BaseTestCase):
|
|||||||
mock.ANY,
|
mock.ANY,
|
||||||
process_input='hard_timeout=0,idle_timeout=0,priority=1,'
|
process_input='hard_timeout=0,idle_timeout=0,priority=1,'
|
||||||
'cookie=%d,actions=drop' % cookie,
|
'cookie=%d,actions=drop' % cookie,
|
||||||
run_as_root=mock.ANY,
|
run_as_root=True, privsep_exec=True
|
||||||
) for cookie in (update_cookie, default_cookie)
|
) for cookie in (update_cookie, default_cookie)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user