summaryrefslogtreecommitdiff
path: root/openstackclient/tests/functional/compute/v2/test_keypair.py
diff options
context:
space:
mode:
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'))