maint: don't require write access when reading files

Change 'r+' to 'r' for open() when just reading.
The '+' is uneeded and distracting.

Change-Id: I8c611ab6d63e165f86e588992011f73f69565249
This commit is contained in:
Pádraig Brady
2012-08-01 16:08:21 +01:00
parent 890f296e6e
commit e4c51dacf6
2 changed files with 2 additions and 2 deletions

View File

@@ -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 ''

View File

@@ -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()