---
lib/python/util.py | 3 +++
tests/initscripts/initscripts.py | 6 +++---
tests/rpmguard/rpmguard.py | 5 +++--
tests/rpmlint/rpmlint.py | 4 ++--
4 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/lib/python/util.py b/lib/python/util.py
index ed90ba4..b6d0013 100644
--- a/lib/python/util.py
+++ b/lib/python/util.py
@@ -96,6 +96,9 @@ def checkhash(filename, algo, hexdigest):
def check_opt_in(pkgname, dist_release):
"""take a package name and distribution release and check for an
autoqa-optin file"""
+ if not pkgname or not dist_release:
+ return False
+
url = 'http://fedorapeople.org/packages/'
fullurl = url + '%s/%s/%s/autoqa-optin' % (pkgname[0].lower(), pkgname,
dist_release)
tmout = socket.getdefaulttimeout()
diff --git a/tests/initscripts/initscripts.py b/tests/initscripts/initscripts.py
index 0806107..1885003 100644
--- a/tests/initscripts/initscripts.py
+++ b/tests/initscripts/initscripts.py
@@ -152,9 +152,9 @@ class initscripts(AutoQATest):
self.highlights = "Following tests returned zero exit code: %s\n" %
repr(tests_exit_status_zero)
self.highlights += "Following tests returned NON-zero exit code: %s\n"
% repr(tests_exit_status_nonzero)
- #add subscribed package owners to mail-to
- collection_name = repoinfo.getrepo_by_tag(kojitag)['collection_name']
- if collection_name and autoqa.util.check_opt_in(name, collection_name):
+ # email results to mailing list and to pkg owner if they optin
+ repo = repoinfo.getrepo_by_tag(kojitag)
+ if repo is not None and autoqa.util.check_opt_in(name,
repo['collection_name']):
#FIXME - hardcoded partial email address here - obviously sub-par
self.mail_to.append('%s-owner(a)fedoraproject.org' % name)
diff --git a/tests/rpmguard/rpmguard.py b/tests/rpmguard/rpmguard.py
index a0e7e74..b317089 100644
--- a/tests/rpmguard/rpmguard.py
+++ b/tests/rpmguard/rpmguard.py
@@ -188,8 +188,9 @@ rpmlint | cut -d ' ' -f 1", retain_output=True)
self.summary = '%u warnings for package %s' % (warning_count, envr)
self.outputs = log
- collection_name = repoinfo.getrepo_by_tag(kojitag)['collection_name']
- if collection_name and autoqa.util.check_opt_in(name, collection_name):
+ # email results to mailing list and to pkg owner if they optin
+ repo = repoinfo.getrepo_by_tag(kojitag)
+ if repo is not None and autoqa.util.check_opt_in(name,
repo['collection_name']):
#FIXME - hardcoded partial email address here - obviously sub-par
self.mail_to.append('%s-owner(a)fedoraproject.org' % name)
diff --git a/tests/rpmlint/rpmlint.py b/tests/rpmlint/rpmlint.py
index adcfb13..1189298 100644
--- a/tests/rpmlint/rpmlint.py
+++ b/tests/rpmlint/rpmlint.py
@@ -69,8 +69,8 @@ class rpmlint(AutoQATest):
self.summary = '%s for package %s' % (summary, envr)
# email results to mailing list and to pkg owner if they optin
- collection_name = repoinfo.getrepo_by_tag(kojitag)['collection_name']
- if collection_name and autoqa.util.check_opt_in(name, collection_name):
+ repo = repoinfo.getrepo_by_tag(kojitag)
+ if repo is not None and autoqa.util.check_opt_in(name,
repo['collection_name']):
#FIXME - hardcoded partial email address here - obviously sub-par
self.mail_to.append('%s-owner(a)fedoraproject.org' % name)
--
1.7.2.1
Show replies by date
On Fri, 2010-08-20 at 12:46 +0200, Kamil Páral wrote:
lib/python/util.py | 3 +++
tests/initscripts/initscripts.py | 6 +++---
tests/rpmguard/rpmguard.py | 5 +++--
tests/rpmlint/rpmlint.py | 4 ++--
4 files changed, 11 insertions(+), 7 deletions(-)
Looks like it should do the job - applied and pushed.
-w