summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTerryHowe <terrylhowe@gmail.com>2015-04-25 09:38:55 -0600
committerTerryHowe <terrylhowe@gmail.com>2015-04-26 06:37:36 -0600
commit416d840dc4cb00026bac2512b259ce88a0e4a765 (patch)
treea4111b355806be6e8fefd4c47188188c96af6d0b
parent2c6c94be52cef38d412b6a09d29f67220a04b670 (diff)
downloadpython-openstackclient-416d840dc4cb00026bac2512b259ce88a0e4a765.tar.gz
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
-rw-r--r--functional/common/test.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/functional/common/test.py b/functional/common/test.py
index 464844fa..4a92def0 100644
--- a/functional/common/test.py
+++ b/functional/common/test.py
@@ -26,10 +26,8 @@ ROOT_DIR = os.path.normpath(os.path.join(FUNCTIONAL_DIR, '..'))
EXAMPLE_DIR = os.path.join(ROOT_DIR, 'examples')
-def execute(cmd, action, flags='', params='', fail_ok=False,
- merge_stderr=False):
+def execute(cmd, fail_ok=False, merge_stderr=False):
"""Executes specified command for the given action."""
- cmd = ' '.join([cmd, flags, action, params])
cmd = shlex.split(cmd.encode('utf-8'))
result = ''
result_err = ''
@@ -47,9 +45,10 @@ class TestCase(testtools.TestCase):
delimiter_line = re.compile('^\+\-[\+\-]+\-\+$')
- def openstack(self, action, flags='', params='', fail_ok=False):
+ @classmethod
+ def openstack(cls, cmd, fail_ok=False):
"""Executes openstackclient command for the given action."""
- return execute('openstack', action, flags, params, fail_ok)
+ return execute('openstack ' + cmd, fail_ok=fail_ok)
def assert_table_structure(self, items, field_names):
"""Verify that all items have keys listed in field_names."""