diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-03-04 23:39:16 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-03-04 23:39:16 +0000 |
| commit | 5c1633f5050a21ad1866eb3056df74595780e5ae (patch) | |
| tree | 927fba84bb98294d1586f9673e64b0e392ad97b4 /openstackclient/compute | |
| parent | 3ede46d4d089a315bc1792bca318d8481013b585 (diff) | |
| parent | 042e2b7d53222618c76870effa3d74759ccc696a (diff) | |
| download | python-openstackclient-5c1633f5050a21ad1866eb3056df74595780e5ae.tar.gz | |
Merge "[compute] Add unit test for keypair"
Diffstat (limited to 'openstackclient/compute')
| -rw-r--r-- | openstackclient/compute/v2/keypair.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/openstackclient/compute/v2/keypair.py b/openstackclient/compute/v2/keypair.py index 71c9d674..22d918a4 100644 --- a/openstackclient/compute/v2/keypair.py +++ b/openstackclient/compute/v2/keypair.py @@ -15,6 +15,7 @@ """Keypair action implementations""" +import io import os import six import sys @@ -47,7 +48,8 @@ class CreateKeypair(command.ShowOne): public_key = parsed_args.public_key if public_key: try: - with open(os.path.expanduser(parsed_args.public_key)) as p: + with io.open(os.path.expanduser(parsed_args.public_key), + "rb") as p: public_key = p.read() except IOError as e: msg = "Key file %s not found: %s" |
