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:
		| @@ -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 '' | ||||
|   | ||||
| @@ -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() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Pádraig Brady
					Pádraig Brady