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.web11.12356.1625604999090344275 for ; Tue, 06 Jul 2021 13:56:39 -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 B3FBB139F; Tue, 6 Jul 2021 13:56:38 -0700 (PDT) Received: from e120189.arm.com (unknown [10.57.77.153]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2CB0F3F5A1; Tue, 6 Jul 2021 13:56:36 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io, Sean Brogan , Bret Barkelew , Michael D Kinney , Liming Gao , Sami Mujawar Subject: [PATCH v2 3/4] .pytool/EccCheck: Check ecc_csv exists Date: Tue, 6 Jul 2021 21:55:40 +0100 Message-Id: <20210706205541.9176-4-Pierre.Gondois@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210706205541.9176-1-Pierre.Gondois@arm.com> References: <20210706205541.9176-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