Checks if path exists before try to remove of avoid exception.
Signed-off-by: Aníbal Limón <[email protected]>
---
meta/lib/oeqa/core/utils/path.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/meta/lib/oeqa/core/utils/path.py b/meta/lib/oeqa/core/utils/path.py
index cb06523..a21caad 100644
--- a/meta/lib/oeqa/core/utils/path.py
+++ b/meta/lib/oeqa/core/utils/path.py
@@ -12,3 +12,8 @@ def findFile(file_name, directory):
if file_name in f:
return os.path.join(r, file_name)
return None
+
+def remove_safe(path):
+ if os.path.exists(path):
+ os.remove(path)
+
--
2.1.4
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core