summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-08-01 16:18:09 +0000
committerGerrit Code Review <review@openstack.org>2012-08-01 16:18:09 +0000
commit906e32baf614f42e72c3eb5fabfd18e05a3c3a2b (patch)
tree62dce513313890e60381b7abda127df77ed5efef /nova
parent3a35d9c03dedee38f2de367de5f67846a24da490 (diff)
parentf01fc5deb9ecdba5918ddf113c62497d5be35dc5 (diff)
Merge "maint: don't require write access when reading files"
Diffstat (limited to 'nova')
-rw-r--r--nova/tests/fake_libvirt_utils.py2
-rw-r--r--nova/tests/test_libvirt.py2
-rw-r--r--nova/tests/test_utils.py2
-rw-r--r--nova/virt/libvirt/utils.py2
4 files changed, 4 insertions, 4 deletions
diff --git a/nova/tests/fake_libvirt_utils.py b/nova/tests/fake_libvirt_utils.py
index 1196e8576..aa613f35d 100644
--- a/nova/tests/fake_libvirt_utils.py
+++ b/nova/tests/fake_libvirt_utils.py
@@ -104,7 +104,7 @@ def file_open(path, mode=None):
def load_file(path):
if os.path.exists(path):
- with open(path, 'r+') as fp:
+ with open(path, 'r') as fp:
return fp.read()
else:
return ''
diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py
index 4e6e1ec48..10ed64429 100644
--- a/nova/tests/test_libvirt.py
+++ b/nova/tests/test_libvirt.py
@@ -1989,7 +1989,7 @@ class LibvirtConnTestCase(test.TestCase):
return FakeVirtDomain(fake_dom_xml)
def _fake_flush(self, fake_pty):
- with open(fake_pty, 'r+') as fp:
+ with open(fake_pty, 'r') as fp:
return fp.read()
self.create_fake_libvirt_mock()
diff --git a/nova/tests/test_utils.py b/nova/tests/test_utils.py
index eb7fce1e0..7513ca12e 100644
--- a/nova/tests/test_utils.py
+++ b/nova/tests/test_utils.py
@@ -73,7 +73,7 @@ exit 1
tmpfilename, tmpfilename2, attempts=10,
process_input='foo',
delay_on_retry=False)
- fp = open(tmpfilename2, 'r+')
+ fp = open(tmpfilename2, 'r')
runs = fp.read()
fp.close()
self.assertNotEquals(runs.strip(), 'failure', 'stdin did not '
diff --git a/nova/virt/libvirt/utils.py b/nova/virt/libvirt/utils.py
index 55bca7996..c954d70ad 100644
--- a/nova/virt/libvirt/utils.py
+++ b/nova/virt/libvirt/utils.py
@@ -343,7 +343,7 @@ def load_file(path):
:param path: File to read
"""
- with open(path, 'r+') as fp:
+ with open(path, 'r') as fp:
return fp.read()