public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Brian Dolbec" <dolsen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/
Date: Mon, 10 Jul 2017 23:01:56 +0000 (UTC)	[thread overview]
Message-ID: <1499727650.d39ec879d0dc5b25c8650d9c20e8914a51ceb886.dolsen@gentoo> (raw)

commit:     d39ec879d0dc5b25c8650d9c20e8914a51ceb886
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 10 21:40:40 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Jul 10 23:00:50 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=d39ec879

repoman: qa_data.py: Make it use masters stacking

Update logging message with 'QAData: ' prefix

Signed-off-by: Brian Dolbec <dolsen <AT> gentoo.org>

 repoman/pym/repoman/qa_data.py | 32 +++++++++++++++++++++-----------
 1 file changed, 21 insertions(+), 11 deletions(-)

diff --git a/repoman/pym/repoman/qa_data.py b/repoman/pym/repoman/qa_data.py
index fed556628..50a1c764d 100644
--- a/repoman/pym/repoman/qa_data.py
+++ b/repoman/pym/repoman/qa_data.py
@@ -28,21 +28,31 @@ class QAData(object):
 		self.no_exec = None
 
 
-	def load_repo_config(self, repopath, options):
+	def load_repo_config(self, repopaths, options):
 		'''Load the repository repoman qa_data.yml config
 
-		@param repopath: string, The path of the repository being scanned
+		@param repopaths: list of strings, The path of the repository being scanned
 						 This could be a parent repository using the
 						 repoman_masters layout.conf variable
 		'''
-		filepath = os.path.join(repopath, 'metadata/repoman/qa_data.yml')
-		logging.debug("QAData: reading file: %s", filepath)
-		try:
-			with open(filepath, 'r') as qadata_file:
-				qadata = yaml.safe_load(qadata_file.read())
-		except IOError as error:
-			logging.error("Failed to load 'qa_data.yml' file at path: %s", filepath)
-			logging.eception(error)
+		qadata = {}
+		for path in repopaths:
+			filepath = os.path.join(path, 'qa_data.yml')
+			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.yml' file at path: %s", filepath)
+				logging.exception(error)
+				return False
+		if qadata == {}:
+			logging.error("QAData: Failed to load a valid 'qa_data.yml' file at paths: %s", repopaths)
 			return False
 		self.max_desc_len = qadata.get('max_description_length', 80)
 		self.allowed_filename_chars = qadata.get("allowed_filename_chars", "a-zA-Z0-9._-+:")
@@ -69,7 +79,7 @@ class QAData(object):
 		for x in self.missingvars:
 			x += ".missing"
 			if x not in self.qacats:
-				logging.warning('* missingvars values need to be added to qahelp ("%s")' % x)
+				logging.warning('QAData: * missingvars values need to be added to qahelp ("%s")' % x)
 				self.qacats.append(x)
 				self.qawarnings.add(x)
 


             reply	other threads:[~2017-07-10 23:02 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-10 23:01 Brian Dolbec [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-08-17  1:59 [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/ Brian Dolbec
2017-08-06  6:54 Michał Górny
2017-07-15  2:29 Brian Dolbec
2017-07-15  2:29 Brian Dolbec
2017-07-15  2:08 Brian Dolbec
2017-07-15  2:08 Brian Dolbec
2017-07-10 23:01 Brian Dolbec
2017-07-10 23:01 Brian Dolbec
2017-07-10 22:31 Brian Dolbec
2017-07-10 22:31 Brian Dolbec
2017-07-10 22:31 Brian Dolbec
2017-07-10 22:31 Brian Dolbec
2017-07-10 22:31 Brian Dolbec
2017-07-10 22:31 Brian Dolbec
2017-07-10 17:52 Brian Dolbec
2017-07-10 17:52 Brian Dolbec
2017-07-10 17:52 Brian Dolbec
2017-06-27 22:10 Brian Dolbec
2017-06-27 22:10 Brian Dolbec
2017-06-27 22:10 Brian Dolbec
2017-06-27 21:36 Brian Dolbec
2017-06-27 21:36 Brian Dolbec
2017-06-27 21:36 Brian Dolbec
2017-06-27 21:36 Brian Dolbec
2017-06-27 20:06 Brian Dolbec
2017-06-27 20:06 Brian Dolbec
2017-06-27 20:06 Brian Dolbec
2016-05-15 23:51 [gentoo-commits] proj/portage:master " Brian Dolbec
2016-05-15 18:34 ` [gentoo-commits] proj/portage:repoman " Brian Dolbec
2016-05-15  8:40 Brian Dolbec
2016-05-15  4:13 Brian Dolbec
2016-05-15  2:37 Brian Dolbec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1499727650.d39ec879d0dc5b25c8650d9c20e8914a51ceb886.dolsen@gentoo \
    --to=dolsen@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox