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.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/openstackclient/tests/functional/compute/v2/test_keypair.py b/openstackclient/tests/functional/compute/v2/test_keypair.py
index 9a88e66f..42f334a4 100644
--- a/openstackclient/tests/functional/compute/v2/test_keypair.py
+++ b/openstackclient/tests/functional/compute/v2/test_keypair.py
@@ -88,7 +88,7 @@ class KeypairTests(KeypairBase):
1) Create keypair with given public key
2) Delete keypair
"""
- with tempfile.NamedTemporaryFile() as f:
+ with tempfile.NamedTemporaryFile(mode='w+') as f:
f.write(self.PUBLIC_KEY)
f.flush()
@@ -108,7 +108,7 @@ class KeypairTests(KeypairBase):
1) Create keypair with private key file
2) Delete keypair
"""
- with tempfile.NamedTemporaryFile() as f:
+ with tempfile.NamedTemporaryFile(mode='w+') as f:
cmd_output = json.loads(self.openstack(
'keypair create -f json --private-key %s tmpkey' % f.name,
))