cros_disks: Handle the case when chmod() is not implemented by filesystems.
Some filesystem implementations do not support chmod(). This CL modifies
FilesystemTestFile in cros_disks.py to ignore chmod() errors raised as
OSError.
BUG=chromium-os:39041
TEST=Run platform_CrosDisksFilesystem with exFAT tests.
Change-Id: I5ca4c7f22ad4227f4ce2ba7c7153a6ea1757580d
Reviewed-on: https://gerrit.chromium.org/gerrit/43563
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
diff --git a/client/cros/cros_disks.py b/client/cros/cros_disks.py
index 025d4ce..9ee80f3 100644
--- a/client/cros/cros_disks.py
+++ b/client/cros/cros_disks.py
@@ -507,7 +507,8 @@
with ExceptionSuppressor(IOError):
with open(path, 'wb+') as f:
f.write(self._content)
- os.chmod(path, self._mode)
+ with ExceptionSuppressor(OSError):
+ os.chmod(path, self._mode)
return True
return False