Merge "maint: don't require write access when reading files"
This commit is contained in:
@@ -104,7 +104,7 @@ def file_open(path, mode=None):
|
|||||||
|
|
||||||
def load_file(path):
|
def load_file(path):
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
with open(path, 'r+') as fp:
|
with open(path, 'r') as fp:
|
||||||
return fp.read()
|
return fp.read()
|
||||||
else:
|
else:
|
||||||
return ''
|
return ''
|
||||||
|
|||||||
@@ -1989,7 +1989,7 @@ class LibvirtConnTestCase(test.TestCase):
|
|||||||
return FakeVirtDomain(fake_dom_xml)
|
return FakeVirtDomain(fake_dom_xml)
|
||||||
|
|
||||||
def _fake_flush(self, fake_pty):
|
def _fake_flush(self, fake_pty):
|
||||||
with open(fake_pty, 'r+') as fp:
|
with open(fake_pty, 'r') as fp:
|
||||||
return fp.read()
|
return fp.read()
|
||||||
|
|
||||||
self.create_fake_libvirt_mock()
|
self.create_fake_libvirt_mock()
|
||||||
|
|||||||
Reference in New Issue
Block a user