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 C5E14139696 for ; Sat, 15 Jul 2017 02:08:52 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 86C34E0E06; Sat, 15 Jul 2017 02:08:50 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 5FC69E0E06 for ; Sat, 15 Jul 2017 02:08:49 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 495703418CD for ; Sat, 15 Jul 2017 02:08:48 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B26C174B6 for ; Sat, 15 Jul 2017 02:08:46 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1500084507.7ccac26b5858b0359bc5fcb076c8af2d336a3a56.dolsen@gentoo> Subject: [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/ X-VCS-Repository: proj/portage X-VCS-Files: repoman/pym/repoman/qa_data.py X-VCS-Directories: repoman/pym/repoman/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 7ccac26b5858b0359bc5fcb076c8af2d336a3a56 X-VCS-Branch: repoman Date: Sat, 15 Jul 2017 02:08:46 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 54039f45-c664-4883-9ae3-36affcb01e5a X-Archives-Hash: 82ad4dfe937ba06c36a0b9ed03ea7218 commit: 7ccac26b5858b0359bc5fcb076c8af2d336a3a56 Author: Brian Dolbec gentoo org> AuthorDate: Sat Jul 15 00:09:11 2017 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Sat Jul 15 02:08:27 2017 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=7ccac26b repoman: Update qa_data.py to use the new load_config() utility repoman/pym/repoman/qa_data.py | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/repoman/pym/repoman/qa_data.py b/repoman/pym/repoman/qa_data.py index 2ccea1996..e361dd62e 100644 --- a/repoman/pym/repoman/qa_data.py +++ b/repoman/pym/repoman/qa_data.py @@ -8,6 +8,7 @@ from _emerge.Package import Package # import our initialized portage instance from repoman._portage import portage +from repoman.config import load_config class QAData(object): @@ -35,22 +36,7 @@ class QAData(object): This could be a parent repository using the repoman_masters layout.conf variable ''' - qadata = {} - for path in repopaths: - filepath = os.path.join(path, 'qa_data.yaml') - logging.debug("QAData: reading file: %s", filepath) - try: - with open(filepath, 'r') as qadata_file: - new_qadata = yaml.safe_load(qadata_file.read()) - logging.debug("QAData: updating qadata with new values from: %s", filepath) - qadata.update(new_qadata) - except FileNotFoundError: - # skip a master that may not have our file - logging.debug("QAData: File not found at path: %s", filepath) - except IOError as error: - logging.error("QAData: Failed to load 'qa_data.yaml' file at path: %s", filepath) - logging.exception(error) - return False + qadata = load_config([os.path.join(path,'qa_data.yaml') for path in repopaths], 'yaml') if qadata == {}: logging.error("QAData: Failed to load a valid 'qa_data.yaml' file at paths: %s", repopaths) return False @@ -93,7 +79,7 @@ class QAData(object): # file.executable self.no_exec = frozenset(qadata.get("no_exec_files", [])) - logging.debug("QAData: completed loading file: %s", filepath) + logging.debug("QAData: completed loading file: %s", repopaths) return True