aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/buildperf/base.py
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2016-08-12 14:35:54 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-17 10:35:27 +0100
commitc86bf80abd87acb0da5860806822c64ec9dee089 (patch)
tree122696cc6564003987df9c95fd0da9d77e8b6619 /meta/lib/oeqa/buildperf/base.py
parent240f6e7366c8a9ea830e531d307dd2e27a61a6bd (diff)
downloadopenembedded-core-contrib-c86bf80abd87acb0da5860806822c64ec9dee089.tar.gz
oeqa.buildperf: use oe.path.remove()
Drop the self-baked force_rm() method. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/lib/oeqa/buildperf/base.py')
-rw-r--r--meta/lib/oeqa/buildperf/base.py15
1 files changed, 4 insertions, 11 deletions
diff --git a/meta/lib/oeqa/buildperf/base.py b/meta/lib/oeqa/buildperf/base.py
index fe18181f2b..c1dc86e5db 100644
--- a/meta/lib/oeqa/buildperf/base.py
+++ b/meta/lib/oeqa/buildperf/base.py
@@ -23,6 +23,7 @@ import unittest
from datetime import datetime, timedelta
from functools import partial
+import oe.path
from oeqa.utils.commands import CommandError, runCmd, get_bb_vars
from oeqa.utils.git import GitError, GitRepo
@@ -297,29 +298,21 @@ class BuildPerfTestCase(unittest.TestCase):
shutil.move(self.bb_vars['BUILDSTATS_BASE'],
os.path.join(self.out_dir, 'buildstats-' + self.name))
- @staticmethod
- def force_rm(path):
- """Equivalent of 'rm -rf'"""
- if os.path.isfile(path) or os.path.islink(path):
- os.unlink(path)
- elif os.path.isdir(path):
- shutil.rmtree(path)
-
def rm_tmp(self):
"""Cleanup temporary/intermediate files and directories"""
log.debug("Removing temporary and cache files")
for name in ['bitbake.lock', 'conf/sanity_info',
self.bb_vars['TMPDIR']]:
- self.force_rm(name)
+ oe.path.remove(name, recurse=True)
def rm_sstate(self):
"""Remove sstate directory"""
log.debug("Removing sstate-cache")
- self.force_rm(self.bb_vars['SSTATE_DIR'])
+ oe.path.remove(self.bb_vars['SSTATE_DIR'], recurse=True)
def rm_cache(self):
"""Drop bitbake caches"""
- self.force_rm(self.bb_vars['PERSISTENT_DIR'])
+ oe.path.remove(self.bb_vars['PERSISTENT_DIR'], recurse=True)
@staticmethod
def sync():