public inbox for gentoo-catalyst@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-catalyst] [PATCH 1/2] catalyst: Remove clear_dir's never used clear_nondir parameter
@ 2021-06-10  3:28 Matt Turner
  2021-06-10  3:28 ` [gentoo-catalyst] [PATCH 2/2] catalyst: Replace snakeoil's locks with fasteners Matt Turner
  0 siblings, 1 reply; 2+ messages in thread
From: Matt Turner @ 2021-06-10  3:28 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: Matt Turner

Signed-off-by: Matt Turner <mattst88@gentoo.org>
---
 catalyst/fileops.py | 11 +++--------
 1 file 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))
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-10  3:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-10  3:28 [gentoo-catalyst] [PATCH 1/2] catalyst: Remove clear_dir's never used clear_nondir parameter Matt Turner
2021-06-10  3:28 ` [gentoo-catalyst] [PATCH 2/2] catalyst: Replace snakeoil's locks with fasteners Matt Turner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox