summaryrefslogtreecommitdiff
path: root/openstackclient/tests/functional/compute/v2/test_keypair.py
diff options
context:
space:
mode:
authorStephen Finucane <sfinucan@redhat.com>2022-11-08 10:56:26 +0000
committerStephen Finucane <sfinucan@redhat.com>2022-11-29 16:21:29 +0000
commit874519e980b75aa7a659cef7757a154ddd10e3fb (patch)
treef34c9b94d94a2b7037dbd9f472bb4d2a1719f7a2 /openstackclient/tests/functional/compute/v2/test_keypair.py
parent6daa6be3926be389cb7cb2faeb921c7230855af3 (diff)
downloadpython-openstackclient-874519e980b75aa7a659cef7757a154ddd10e3fb.tar.gz
tests: Convert compute tests to use 'parse_output'
Change-Id: Ib5b2f46639f14877a9ec295b26cae01a05395d4d Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Diffstat (limited to 'openstackclient/tests/functional/compute/v2/test_keypair.py')
-rw-r--r--openstackclient/tests/functional/compute/v2/test_keypair.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/openstackclient/tests/functional/compute/v2/test_keypair.py b/openstackclient/tests/functional/compute/v2/test_keypair.py
index 42f334a4..828d5dad 100644
--- a/openstackclient/tests/functional/compute/v2/test_keypair.py
+++ b/openstackclient/tests/functional/compute/v2/test_keypair.py
@@ -10,7 +10,6 @@
# License for the specific language governing permissions and limitations
# under the License.
-import json
import tempfile
from tempest.lib.common.utils import data_utils
@@ -109,9 +108,10 @@ class KeypairTests(KeypairBase):
2) Delete keypair
"""
with tempfile.NamedTemporaryFile(mode='w+') as f:
- cmd_output = json.loads(self.openstack(
- 'keypair create -f json --private-key %s tmpkey' % f.name,
- ))
+ cmd_output = self.openstack(
+ 'keypair create --private-key %s tmpkey' % f.name,
+ parse_output=True,
+ )
self.addCleanup(self.openstack, 'keypair delete tmpkey')
self.assertEqual('tmpkey', cmd_output.get('name'))
self.assertIsNotNone(cmd_output.get('user_id'))