Merge "[trivial] Remove default parameter from execute"

This commit is contained in:
Zuul 2021-03-01 11:27:26 +00:00 committed by Gerrit Code Review
commit b23f4d39ab
3 changed files with 6 additions and 15 deletions

View File

@ -324,7 +324,7 @@ def mount(src, dest, *args):
to run the process.
"""
args = ('mount', ) + args + (src, dest)
execute(*args, run_as_root=True, check_exit_code=[0])
execute(*args, run_as_root=True)
def umount(loc, *args):
@ -337,7 +337,7 @@ def umount(loc, *args):
to run the process.
"""
args = ('umount', ) + args + (loc, )
execute(*args, run_as_root=True, check_exit_code=[0])
execute(*args, run_as_root=True)
def check_dir(directory_to_check=None, required_space=1):

View File

@ -71,7 +71,6 @@ def discovery(portal_address, portal_port):
'-p', '%s:%s' % (utils.wrap_ipv6(portal_address),
portal_port),
run_as_root=True,
check_exit_code=[0],
attempts=5,
delay_on_retry=True)
@ -85,7 +84,6 @@ def login_iscsi(portal_address, portal_port, target_iqn):
'-T', target_iqn,
'--login',
run_as_root=True,
check_exit_code=[0],
attempts=5,
delay_on_retry=True)
@ -150,8 +148,7 @@ def verify_iscsi_connection(target_iqn):
out, _err = utils.execute('iscsiadm',
'-m', 'node',
'-S',
run_as_root=True,
check_exit_code=[0])
run_as_root=True)
if target_iqn in out:
break
time.sleep(1)
@ -172,8 +169,7 @@ def force_iscsi_lun_update(target_iqn):
'-m', 'node',
'-T', target_iqn,
'-R',
run_as_root=True,
check_exit_code=[0])
run_as_root=True)
def logout_iscsi(portal_address, portal_port, target_iqn):
@ -185,7 +181,6 @@ def logout_iscsi(portal_address, portal_port, target_iqn):
'-T', target_iqn,
'--logout',
run_as_root=True,
check_exit_code=[0],
attempts=5,
delay_on_retry=True)

View File

@ -1600,8 +1600,7 @@ class PhysicalWorkTestCase(tests_base.TestCase):
'iscsiadm',
'-m', 'node',
'-S',
run_as_root=True,
check_exit_code=[0])
run_as_root=True)
@mock.patch.object(utils, 'execute', autospec=True)
def test_force_iscsi_lun_update(self, mock_exec):
@ -1612,8 +1611,7 @@ class PhysicalWorkTestCase(tests_base.TestCase):
'-m', 'node',
'-T', iqn,
'-R',
run_as_root=True,
check_exit_code=[0])
run_as_root=True)
@mock.patch.object(utils, 'execute', autospec=True)
@mock.patch.object(iscsi_deploy, 'verify_iscsi_connection', autospec=True)
@ -1637,7 +1635,6 @@ class PhysicalWorkTestCase(tests_base.TestCase):
'-T', iqn,
'--login',
run_as_root=True,
check_exit_code=[0],
attempts=5,
delay_on_retry=True)
@ -1778,7 +1775,6 @@ class PhysicalWorkTestCase(tests_base.TestCase):
'-T', iqn,
'--login',
run_as_root=True,
check_exit_code=[0],
attempts=5,
delay_on_retry=True)