[OE-core] [PATCHv2 17/32] oeqa/utils/path: Add remove_safe function

Burton, Ross ross.burton at intel.com
Thu Dec 8 14:41:41 UTC 2016


Can you squash this into the commit that added core/utils/path.

Ross

On 7 December 2016 at 20:32, Aníbal Limón <anibal.limon at linux.intel.com>
wrote:

> Checks if path exists before try to remove of avoid exception.
>
> Signed-off-by: Aníbal Limón <anibal.limon at linux.intel.com>
> ---
>  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
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20161208/1bf5bc22/attachment-0002.html>


More information about the Openembedded-core mailing list