From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web08.4299.1624433020276013459 for ; Wed, 23 Jun 2021 00:23:40 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: pierre.gondois@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E28C5113E; Wed, 23 Jun 2021 00:23:34 -0700 (PDT) Received: from e120189.arm.com (unknown [10.57.78.245]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5AD523F719; Wed, 23 Jun 2021 00:23:33 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io, Sean Brogan , Bret Barkelew , Michael D Kinney , Liming Gao , Sami Mujawar Subject: [PATCH v1 3/4] .pytool/EccCheck: Check ecc_csv exists Date: Wed, 23 Jun 2021 08:22:49 +0100 Message-Id: <20210623072250.3277-4-Pierre.Gondois@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210623072250.3277-1-Pierre.Gondois@arm.com> References: <20210623072250.3277-1-Pierre.Gondois@arm.com> From: Pierre Gondois 'workspace_path' being an absolute path leads to 'ecc_csv' being an absolute path. Then it won't be found among 'file' as they are relative paths. Cc: Sean Brogan Cc: Bret Barkelew Cc: Michael D Kinney Cc: Liming Gao Cc: Sami Mujawar Signed-off-by: Pierre Gondois --- .pytool/Plugin/EccCheck/EccCheck.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.pytool/Plugin/EccCheck/EccCheck.py b/.pytool/Plugin/EccCheck/EccCheck.py index fff317f23110..87f0e65a140f 100644 --- a/.pytool/Plugin/EccCheck/EccCheck.py +++ b/.pytool/Plugin/EccCheck/EccCheck.py @@ -206,11 +206,10 @@ class EccCheck(ICiBuildPlugin): def ParseEccReport(self, ecc_diff_range: Dict[str, List[Tuple[int, int]]], workspace_path: str) -> None: ecc_log = os.path.join(workspace_path, "Ecc.log") - ecc_csv = "Ecc.csv" - file = os.listdir(workspace_path) + ecc_csv = os.path.join(workspace_path, "Ecc.csv") row_lines = [] ignore_error_code = self.GetIgnoreErrorCode() - if ecc_csv in file: + if os.path.exists(ecc_csv): with open(ecc_csv) as csv_file: reader = csv.reader(csv_file) for row in reader: -- 2.17.1