aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gentoo.org>2021-06-08 21:32:08 -0700
committerMatt Turner <mattst88@gentoo.org>2021-06-08 21:32:08 -0700
commitfbe56d75989fabf29e7b642515df69737cf62cc1 (patch)
tree5737cf566ae9168b5787a2124370a1736f423fd4 /catalyst
parentcatalyst: Remove @staticmethod from generate_hash() (diff)
downloadcatalyst-fbe56d75989fabf29e7b642515df69737cf62cc1.tar.gz
catalyst-fbe56d75989fabf29e7b642515df69737cf62cc1.tar.bz2
catalyst-fbe56d75989fabf29e7b642515df69737cf62cc1.zip
catalyst: Remove clear_dir's never used clear_nondir parameter
Signed-off-by: Matt Turner <mattst88@gentoo.org>
Diffstat (limited to 'catalyst')
-rw-r--r--catalyst/fileops.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/catalyst/fileops.py b/catalyst/fileops.py
index 59525420..4252285e 100644
--- a/catalyst/fileops.py
+++ b/catalyst/fileops.py
@@ -46,8 +46,7 @@ def ensure_dirs(path, gid=-1, uid=-1, mode=0o755, minimal=True,
return succeeded
-def clear_dir(target, mode=0o755, remove=False,
- clear_nondir=True):
+def clear_dir(target, mode=0o755, remove=False):
'''Universal directory clearing function
@target: string, path to be cleared or removed
@@ -74,12 +73,8 @@ def clear_dir(target, mode=0o755, remove=False,
log.error('clear_dir failed', exc_info=True)
return False
elif os.path.exists(target):
- if clear_nondir:
- log.debug("Clearing (unlinking) non-directory: %s", target)
- os.unlink(target)
- else:
- log.info('clear_dir failed: %s: is not a directory', target)
- return False
+ log.debug("Clearing (unlinking) non-directory: %s", target)
+ os.unlink(target)
else:
log.debug("Conditions not met to clear: %s", target)
log.debug(" isdir: %s", os.path.isdir(target))