Merge pull request #77 from bjackman/cgroups-shutils-fix
shutils/cgroups: Don't fail when racing with process exit
diff --git a/devlib/target.py b/devlib/target.py
index be77180..7623cd3 100644
--- a/devlib/target.py
+++ b/devlib/target.py
@@ -362,7 +362,8 @@
def file_exists(self, filepath):
command = 'if [ -e \'{}\' ]; then echo 1; else echo 0; fi'
- return boolean(self.execute(command.format(filepath)).strip())
+ output = self.execute(command.format(filepath), as_root=self.is_rooted)
+ return boolean(output.strip())
def directory_exists(self, filepath):
output = self.execute('if [ -d \'{}\' ]; then echo 1; else echo 0; fi'.format(filepath))