[oe-commits] [openembedded-core] 01/20: oeqa/selftest/case: Use bb.utils.remove() instead of shutil.remove()
git at git.openembedded.org
git at git.openembedded.org
Tue Nov 27 22:15:59 UTC 2018
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master
in repository openembedded-core.
commit 00a8fd5b93a5c19ce0b7498e2bc653ce8ad58aaf
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Tue Nov 27 12:03:50 2018 +0000
oeqa/selftest/case: Use bb.utils.remove() instead of shutil.remove()
This avoids problems where shutil.remove will error with:
File "/usr/lib/python3.5/shutil.py", line 436, in _rmtree_safe_fd
os.unlink(name, dir_fd=topfd)
FileNotFoundError: [Errno 2] No such file or directory: 'S.gpg-agent.extra'
when there are races over file deletion (gpg agent may be slow to exit).
We already worked around speed and race issues in bb.utils.
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/lib/oeqa/selftest/case.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/meta/lib/oeqa/selftest/case.py b/meta/lib/oeqa/selftest/case.py
index 7a90a6b..9c08d59 100644
--- a/meta/lib/oeqa/selftest/case.py
+++ b/meta/lib/oeqa/selftest/case.py
@@ -12,6 +12,8 @@ import oeqa.utils.ftools as ftools
from oeqa.utils.commands import runCmd, bitbake, get_bb_var
from oeqa.core.case import OETestCase
+import bb.utils
+
class OESelftestTestCase(OETestCase):
def __init__(self, methodName="runTest"):
self._extra_tear_down_commands = []
@@ -167,7 +169,7 @@ to ensure accurate results.")
if self._track_for_cleanup:
for path in self._track_for_cleanup:
if os.path.isdir(path):
- shutil.rmtree(path)
+ bb.utils.remove(path, recurse=True)
if os.path.isfile(path):
os.remove(path)
self._track_for_cleanup = []
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list