Skip to content

Commit 416d840

Browse files
committed
Reduce parameters to base class execute
Simplify the parameters so we are just passing a command string to the execute command in the base class. The string is exactly the command we are going to run. This will make debugging easier and make it clearer what we are actually running. Change-Id: I0425007e1849f31d692420e38544c55b1acb86c4
1 parent 2c6c94b commit 416d840

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

‎functional/common/test.py‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,8 @@
2626
EXAMPLE_DIR = os.path.join(ROOT_DIR, 'examples')
2727

2828

29-
def execute(cmd, action, flags='', params='', fail_ok=False,
30-
merge_stderr=False):
29+
def execute(cmd, fail_ok=False, merge_stderr=False):
3130
"""Executes specified command for the given action."""
32-
cmd = ' '.join([cmd, flags, action, params])
3331
cmd = shlex.split(cmd.encode('utf-8'))
3432
result = ''
3533
result_err = ''
@@ -47,9 +45,10 @@ class TestCase(testtools.TestCase):
4745

4846
delimiter_line = re.compile('^\+\-[\+\-]+\-\+$')
4947

50-
def openstack(self, action, flags='', params='', fail_ok=False):
48+
@classmethod
49+
def openstack(cls, cmd, fail_ok=False):
5150
"""Executes openstackclient command for the given action."""
52-
return execute('openstack', action, flags, params, fail_ok)
51+
return execute('openstack ' + cmd, fail_ok=fail_ok)
5352

5453
def assert_table_structure(self, items, field_names):
5554
"""Verify that all items have keys listed in field_names."""

0 commit comments

Comments
 (0)