Merge "TC doesn't rise exception if device doesn't exist"
This commit is contained in:
commit
adfcf111d1
|
@ -200,7 +200,9 @@ class TcCommand(ip_lib.IPDevice):
|
|||
# Return_code=2 is fine because it means
|
||||
# "RTNETLINK answers: No such file or directory" what is fine when we
|
||||
# are trying to delete qdisc
|
||||
return self._execute_tc_cmd(cmd, extra_ok_codes=[2])
|
||||
# Return_code=1 means "RTNETLINK answers: Cannot find device <device>".
|
||||
# If the device doesn't exist, the qdisc is already deleted.
|
||||
return self._execute_tc_cmd(cmd, extra_ok_codes=[1, 2])
|
||||
|
||||
def _get_tbf_burst_value(self, bw_limit, burst_limit):
|
||||
min_burst_value = float(bw_limit) / float(self.kernel_hz)
|
||||
|
|
|
@ -218,7 +218,7 @@ class TestTcCommand(base.BaseTestCase):
|
|||
run_as_root=True,
|
||||
check_exit_code=True,
|
||||
log_fail_as_error=True,
|
||||
extra_ok_codes=[2]
|
||||
extra_ok_codes=[1, 2]
|
||||
),
|
||||
mock.call(
|
||||
['tc', 'qdisc', 'add', 'dev', DEVICE_NAME, "ingress",
|
||||
|
@ -263,7 +263,7 @@ class TestTcCommand(base.BaseTestCase):
|
|||
run_as_root=True,
|
||||
check_exit_code=True,
|
||||
log_fail_as_error=True,
|
||||
extra_ok_codes=[2]
|
||||
extra_ok_codes=[1, 2]
|
||||
)
|
||||
|
||||
def test_delete_tbf_bw_limit(self):
|
||||
|
@ -273,7 +273,7 @@ class TestTcCommand(base.BaseTestCase):
|
|||
run_as_root=True,
|
||||
check_exit_code=True,
|
||||
log_fail_as_error=True,
|
||||
extra_ok_codes=[2]
|
||||
extra_ok_codes=[1, 2]
|
||||
)
|
||||
|
||||
def test_get_ingress_qdisc_burst_value_burst_not_none(self):
|
||||
|
|
Loading…
Reference in New Issue