summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/utils/tests/nova_utils_tests.py
diff options
context:
space:
mode:
authorspisarski <s.pisarski@cablelabs.com>2017-05-25 08:46:40 -0600
committerspisarski <s.pisarski@cablelabs.com>2017-05-25 08:46:40 -0600
commit5718894fcfb3e44dd08435cf71d2f1094425bed5 (patch)
tree49a3d582cb01bff697a648ee901372312d56bdb4 /snaps/openstack/utils/tests/nova_utils_tests.py
parent74386c6efb02cc352b0b090b7150813960ca1c95 (diff)
Updated installation documents and fixed problems found during investigation.
The code changes are primarily required when the runtime environment is Windows. JIRA: SNAPS-75 Change-Id: Ia2134861dd96e1d2c4b597f42fb348929e787a51 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/openstack/utils/tests/nova_utils_tests.py')
-rw-r--r--snaps/openstack/utils/tests/nova_utils_tests.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/snaps/openstack/utils/tests/nova_utils_tests.py b/snaps/openstack/utils/tests/nova_utils_tests.py
index 0a2b24b..98aa889 100644
--- a/snaps/openstack/utils/tests/nova_utils_tests.py
+++ b/snaps/openstack/utils/tests/nova_utils_tests.py
@@ -86,11 +86,13 @@ class NovaUtilsKeypairTests(OSComponentTestCase):
pass
try:
+ os.chmod(self.priv_key_file_path, 0o777)
os.remove(self.priv_key_file_path)
except:
pass
try:
+ os.chmod(self.pub_key_file_path, 0o777)
os.remove(self.pub_key_file_path)
except:
pass
@@ -126,7 +128,9 @@ class NovaUtilsKeypairTests(OSComponentTestCase):
"""
nova_utils.save_keys_to_files(self.keys, self.pub_key_file_path, self.priv_key_file_path)
self.keypair = nova_utils.upload_keypair_file(self.nova, self.keypair_name, self.pub_key_file_path)
- pub_key = open(os.path.expanduser(self.pub_key_file_path)).read()
+ pub_key_file = open(os.path.expanduser(self.pub_key_file_path))
+ pub_key = pub_key_file.read()
+ pub_key_file.close()
self.assertEqual(self.keypair.public_key, pub_key)
def test_floating_ips(self):