[PATCH] Remove koji._forceAscii.
by Ralph Bean
It isn't used anywhere else in the source and its presence is confusing.
(We're supposed to use koji.fixEncoding(..) now, right?)
---
koji/__init__.py | 5 -----
1 file changed, 5 deletions(-)
diff --git a/koji/__init__.py b/koji/__init__.py
index 939b05a..3711018 100644
--- a/koji/__init__.py
+++ b/koji/__init__.py
@@ -2416,11 +2416,6 @@ def _taskLabel(taskInfo):
else:
return '%s (%s)' % (method, arch)
-def _forceAscii(value):
- """Replace characters not in the 7-bit ASCII range
- with "?"."""
- return ''.join([(ord(c) <= 127) and c or '?' for c in value])
-
def fixEncoding(value, fallback='iso8859-15'):
"""
Convert value to a 'str' object encoded as UTF-8.
--
2.4.3
8 years
[PATCH] Fix encoding of chunks before passing to xmlrpclib
by Ralph Bean
This was causing us tracebacks when trying to query for rpm header information
on rpms that had (certain) non-ascii characters in names in the changelog.
---
koji/__init__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/koji/__init__.py b/koji/__init__.py
index 3711018..a4bce0f 100644
--- a/koji/__init__.py
+++ b/koji/__init__.py
@@ -1890,7 +1890,7 @@ class ClientSession(object):
break
if self.opts.get('debug_xmlrpc', False):
print "body: %r" % chunk
- p.feed(chunk)
+ p.feed(fixEncoding(chunk))
p.close()
result = u.close()
if len(result) == 1:
--
2.4.3
8 years
Koji 2.0 questions
by Neal Gompa
Hey all,
I just saw the Koji 2.0 presentation online, and I'm quite interested in
it, especially with the concept of being able to build more than RPMs. For
example, I'd like to see Koji to be able to do reproducible builds of
Debian packages with debbuild[1] (using RPM spec to build Debian packages)
or even traditional methods, virtual machine bundles (qcow2 and ova),
container bundles (Nulecule, appc), and some configurability to support
building for a multitude of distros and targets.
Essentially, I'd like to see some of the interesting capabilities that the
Open Build Service (building for multiple distribution targets, building
virtual machines, container bundles) in a nice, easy to deploy Python
3.x-compatible application. OBS is difficult to set up, maintain, and
integrate into existing workflows, while Koji doesn't try to be an
all-in-one replacement for everything.
Would Koji 2.0 be flexible enough to do all these things without becoming
like the OBS?
Also, on another note, why can't Koji 2.0 use the Python 3.4 Software
Collections[2] on RHEL 6/7? RHEL 7 now has Python 3.4 in EPEL[3], too.
[1]: https://apps.fedoraproject.org/packages/debbuild
[2]: https://www.softwarecollections.org/en/scls/rhscl/rh-python34/
[3]: https://bodhi.fedoraproject.org/updates/?packages=python34
--
真実はいつも一つ!/ Always, there's only one truth!
8 years
[PATCH] Be more careful when detect cert-expiry exceptions.
by Ralph Bean
We ran into this in the Fedora koji instance today after an upgrade last night.
The inline comments explain the reasoning
---
koji/__init__.py | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/koji/__init__.py b/koji/__init__.py
index e7a66f2..939b05a 100644
--- a/koji/__init__.py
+++ b/koji/__init__.py
@@ -1943,8 +1943,29 @@ class ClientSession(object):
except Exception, e:
self._close_connection()
if isinstance(e, OpenSSL.SSL.Error):
+ # pyOpenSSL doesn't use different exception
+ # subclasses, we have to actually parse the args
for arg in e.args:
- for _, _, ssl_reason in arg:
+ # First, check to see if 'arg' is iterable because
+ # it can be anything..
+ try:
+ iter(arg)
+ except TypeError:
+ continue
+
+ # We do all this so that we can detect cert expiry
+ # so we can avoid retrying those over and over.
+ for items in arg:
+ try:
+ iter(items)
+ except TypeError:
+ continue
+
+ if len(items) != 3:
+ continue
+
+ _, _, ssl_reason = items
+
if ('certificate revoked' in ssl_reason or
'certificate expired' in ssl_reason):
# There's no point in retrying for this
--
2.4.3
8 years, 1 month
[PATCH] don't omit debuginfos on buildinfo page
by Mike McLean
---
www/kojiweb/buildinfo.chtml | 2 +-
www/kojiweb/index.py | 8 +++++---
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/www/kojiweb/buildinfo.chtml b/www/kojiweb/buildinfo.chtml
index 07c62fd..77cb249 100644
--- a/www/kojiweb/buildinfo.chtml
+++ b/www/kojiweb/buildinfo.chtml
@@ -127,7 +127,7 @@
#end if
</td>
</tr>
- #for $rpm in $rpmsByArch[$arch] + $debuginfoByArch.get($arch, [])
+ #for $rpm in $rpmsByArch[$arch]
<tr>
#set $rpmfile =
'%(name)s-%(version)s-%(release)s.%(arch)s.rpm' % $rpm
#set $rpmpath = $pathinfo.rpm($rpm)
diff --git a/www/kojiweb/index.py b/www/kojiweb/index.py
index 4be6131..fdbbc27 100644
--- a/www/kojiweb/index.py
+++ b/www/kojiweb/index.py
@@ -1102,12 +1102,15 @@ def buildinfo(environ, buildID):
archivesByExt.setdefault(os.path.splitext(archive['filename'])[1][1:],
[]).append(archive)
rpmsByArch = {}
- debuginfoByArch = {}
+ debuginfos = []
for rpm in rpms:
if koji.is_debuginfo(rpm['name']):
- debuginfoByArch.setdefault(rpm['arch'], []).append(rpm)
+ debuginfos.append(rpm)
else:
rpmsByArch.setdefault(rpm['arch'], []).append(rpm)
+ # add debuginfos at the end
+ for rpm in debuginfos:
+ rpmsByArch.setdefault(rpm['arch'], []).append(rpm)
if rpmsByArch.has_key('src'):
srpm = rpmsByArch['src'][0]
@@ -1163,7 +1166,6 @@ def buildinfo(environ, buildID):
values['build'] = build
values['tags'] = tags
values['rpmsByArch'] = rpmsByArch
- values['debuginfoByArch'] = debuginfoByArch
values['task'] = task
values['mavenbuild'] = mavenbuild
values['winbuild'] = winbuild
--
2.1.0
8 years, 1 month
[PATCH] don't omit debuginfos on buildinfo page
by Mike McLean
---
www/kojiweb/buildinfo.chtml | 2 +-
www/kojiweb/index.py | 8 +++++---
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/www/kojiweb/buildinfo.chtml b/www/kojiweb/buildinfo.chtml
index 07c62fd..77cb249 100644
--- a/www/kojiweb/buildinfo.chtml
+++ b/www/kojiweb/buildinfo.chtml
@@ -127,7 +127,7 @@
#end if
</td>
</tr>
- #for $rpm in $rpmsByArch[$arch] + $debuginfoByArch.get($arch, [])
+ #for $rpm in $rpmsByArch[$arch]
<tr>
#set $rpmfile = '%(name)s-%(version)s-%(release)s.%(arch)s.rpm' % $rpm
#set $rpmpath = $pathinfo.rpm($rpm)
diff --git a/www/kojiweb/index.py b/www/kojiweb/index.py
index 4be6131..fdbbc27 100644
--- a/www/kojiweb/index.py
+++ b/www/kojiweb/index.py
@@ -1102,12 +1102,15 @@ def buildinfo(environ, buildID):
archivesByExt.setdefault(os.path.splitext(archive['filename'])[1][1:], []).append(archive)
rpmsByArch = {}
- debuginfoByArch = {}
+ debuginfos = []
for rpm in rpms:
if koji.is_debuginfo(rpm['name']):
- debuginfoByArch.setdefault(rpm['arch'], []).append(rpm)
+ debuginfos.append(rpm)
else:
rpmsByArch.setdefault(rpm['arch'], []).append(rpm)
+ # add debuginfos at the end
+ for rpm in debuginfos:
+ rpmsByArch.setdefault(rpm['arch'], []).append(rpm)
if rpmsByArch.has_key('src'):
srpm = rpmsByArch['src'][0]
@@ -1163,7 +1166,6 @@ def buildinfo(environ, buildID):
values['build'] = build
values['tags'] = tags
values['rpmsByArch'] = rpmsByArch
- values['debuginfoByArch'] = debuginfoByArch
values['task'] = task
values['mavenbuild'] = mavenbuild
values['winbuild'] = winbuild
--
2.1.0
8 years, 1 month
[PATCH] correct error message in fastUpload
by Mike McLean
---
koji/__init__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/koji/__init__.py b/koji/__init__.py
index e7a66f2..81064c3 100644
--- a/koji/__init__.py
+++ b/koji/__init__.py
@@ -2047,7 +2047,7 @@ class ClientSession(object):
result = self._callMethod('checkUpload', (path, name), chk_opts)
if int(result['size']) != ofs:
raise GenericError, "Uploaded file is wrong length: %s/%s, %s != %s" \
- % (path, name, result['sumlength'], ofs)
+ % (path, name, result['size'], ofs)
if problems and result['hexdigest'] != full_chksum.hexdigest():
raise GenericError, "Uploaded file has wrong checksum: %s/%s, %s != %s" \
% (path, name, result['hexdigest'], full_chksum.hexdigest())
--
2.1.0
8 years, 1 month