From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 28BE31382C5 for ; Thu, 10 Jun 2021 03:28:49 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 555AFE03EC; Thu, 10 Jun 2021 03:28:48 +0000 (UTC) Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D3081E03EC for ; Thu, 10 Jun 2021 03:28:47 +0000 (UTC) Received: by mail-pg1-f178.google.com with SMTP id j12so21430003pgh.7 for ; Wed, 09 Jun 2021 20:28:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=bV4qp2O3jkd4n9Eu+83b7FSNGhp3NBT6LbF3L87CJR0=; b=TFmTFEsFR2D9FHoJ5fgYJSBtUIlOwb0Zo0LhAsM1d0Xdmz4NorZWfmmOkztLwsqnLs TVqAYbpDflzMAloE/9RwnOHEO+FfNRufwZgSl5m7mUM1ARKhIsngtHOYwC47DseE8XZg JtSAjl2Pv5j5e5DpKbNlrPRK9dZa/yw1knDZsdzVcZvm6RTf54p5zg3LQUw6yqoL8li8 3cYqpCAoewJ3s2sGbH8VXEaPLZI7KFN2FcwcQxPMEyVkhbDnYIrB3zqJHxzBxYxyRhiN nVuWUBnjqV1XE4rDxAzeaN1uEqMhmmLO/JAfSGeHyOl1EtU59Hcfp6Wt90ITIc9a0C2j AZdg== X-Gm-Message-State: AOAM531j3yjyXimV1hpNxpZkBrdrfmrAqRR0ph/1U1pdA2BCMj2KAv3E H/49n0H3NsinZs9BZPKBRzKvcOs2dHU= X-Google-Smtp-Source: ABdhPJzUF5ml9fvMZ1bUJ+DBAO3guxcn19DblJOpoTgoyn6DXQtr2TxBbqU1U9tAKWVBPG3onW1wKg== X-Received: by 2002:a63:8f46:: with SMTP id r6mr2959486pgn.182.1623295726175; Wed, 09 Jun 2021 20:28:46 -0700 (PDT) Received: from localhost ([108.161.26.224]) by smtp.gmail.com with ESMTPSA id q18sm847788pfj.5.2021.06.09.20.28.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Jun 2021 20:28:45 -0700 (PDT) From: Matt Turner To: gentoo-catalyst@lists.gentoo.org Cc: Matt Turner Subject: [gentoo-catalyst] [PATCH 1/2] catalyst: Remove clear_dir's never used clear_nondir parameter Date: Wed, 9 Jun 2021 20:28:39 -0700 Message-Id: <20210610032840.466809-1-mattst88@gentoo.org> X-Mailer: git-send-email 2.31.1 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: 1909991a-ceac-4702-8002-be5471bfcb88 X-Archives-Hash: 2f818ce287bc7bf22bf399f66c521748 Signed-off-by: Matt Turner --- 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