diff options
| author | Zuul <zuul@review.opendev.org> | 2022-12-02 14:21:43 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2022-12-02 14:21:43 +0000 |
| commit | a5f207b657fd008fc976f8f553dd579eafef62e5 (patch) | |
| tree | 9355ee6462a18bc38af9109fd52f873693eff330 /openstackclient/tests/functional/volume/base.py | |
| parent | 5aecefe911874519a27ef2fd5903bad792d13c2b (diff) | |
| parent | 686fabef31ee36ec25574ddb086d6e9e3f170045 (diff) | |
| download | python-openstackclient-a5f207b657fd008fc976f8f553dd579eafef62e5.tar.gz | |
Merge "tests: Convert volume tests to use 'parse_output'"
Diffstat (limited to 'openstackclient/tests/functional/volume/base.py')
| -rw-r--r-- | openstackclient/tests/functional/volume/base.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/openstackclient/tests/functional/volume/base.py b/openstackclient/tests/functional/volume/base.py index 53032606..041d8d07 100644 --- a/openstackclient/tests/functional/volume/base.py +++ b/openstackclient/tests/functional/volume/base.py @@ -10,7 +10,6 @@ # License for the specific language governing permissions and limitations # under the License. -import json import time from openstackclient.tests.functional import base @@ -27,10 +26,12 @@ class BaseVolumeTests(base.TestCase): failures = ['error'] total_sleep = 0 while total_sleep < wait: - output = json.loads(cls.openstack( - check_type + ' show -f json ' + check_name)) + output = cls.openstack( + check_type + ' show ' + check_name, + parse_output=True, + ) current_status = output['status'] - if (current_status == desired_status): + if current_status == desired_status: print('{} {} now has status {}' .format(check_type, check_name, current_status)) return @@ -51,7 +52,7 @@ class BaseVolumeTests(base.TestCase): total_sleep = 0 name_field = name_field or 'Name' while total_sleep < wait: - result = json.loads(cls.openstack(check_type + ' list -f json')) + result = cls.openstack(check_type + ' list', parse_output=True) names = [x[name_field] for x in result] if check_name not in names: print('{} {} is now deleted'.format(check_type, check_name)) |
