Commit graph

699 commits

Author SHA1 Message Date
Mike McLean
4e0fe71acb strict option for MultiCallSession class 2019-06-17 10:19:12 -04:00
Mike McLean
abcc993b00 get a MultiCallSession by calling session.multicall 2019-06-17 10:19:12 -04:00
Mike McLean
cecffa8432 add a context manager 2019-06-17 10:19:12 -04:00
Mike McLean
75982719c1 Use VirtualCall helper 2019-06-17 10:19:12 -04:00
Mike McLean
bb110da972 first stab at a new multicall approach 2019-06-17 10:19:12 -04:00
Mikolaj Izdebski
3d058c50db Allow generating separate src repo for build repos
Fixes #1266
2019-05-23 10:01:12 -04:00
Tomas Kopecek
558e129c6b use same arch parsing for cli and hub
Related: https://pagure.io/koji/issue/1237
2019-05-21 18:39:52 -04:00
Tomas Kopecek
e9be2d2464 fix docstring 2019-05-21 12:18:19 -04:00
Tomas Kopecek
df11172629 fix str-type testing in fix_encoding
Fixes: https://pagure.io/koji/issue/1318
2019-05-21 12:18:19 -04:00
Mike McLean
7532682f5e drop duplicate logic 2019-05-21 12:18:19 -04:00
Mike McLean
d2350991eb refactor fixEncodingRecurse 2019-05-21 12:18:19 -04:00
Mike McLean
6c0aacc264 pathinfo.distrepo volume option 2019-05-21 12:14:33 -04:00
Mike McLean
a9fc077a1a fix mode name 2019-05-06 11:23:19 -04:00
Mike McLean
be6ae53fb6 handle bare merge mode
Fixes https://pagure.io/koji/issue/1404
2019-05-06 11:23:19 -04:00
Mike McLean
7c416d68d1 tweak rank calculation 2019-04-09 15:40:00 -04:00
Mike McLean
c4f7724647 scale task_avail_delay based on bin rank 2019-04-09 15:40:00 -04:00
Tomas Kopecek
12cabb0f2c Remove 'keepalive' option
keepalive is not used anymore anywhere in koji

Fixes: https://pagure.io/koji/issue/1239
2019-03-12 10:34:36 -04:00
Mike McLean
3a10134e37 honor remove_nonprintable in fixEncodingRecurse under py3 2019-03-04 10:13:51 -05:00
Tomas Kopecek
eeeeb3ab78 skip fixEncoding for py3 2019-03-04 10:13:51 -05:00
Tomas Kopecek
613d1587a6 fix typo 2019-03-04 10:13:51 -05:00
Tomas Kopecek
4372ecd89b expect string keys in fixEncodingRecurse 2019-03-04 10:13:51 -05:00
Mike McLean
01b0a41639 fix file open mode 2019-03-04 09:28:39 -05:00
Mike McLean
acf5c73ee2 use base64.b64decode 2019-03-04 09:28:39 -05:00
Mike McLean
24f9cb60ba use base64encode most places 2019-03-04 09:28:39 -05:00
Mike McLean
71bc4106b4 new base64 helper functions 2019-03-04 09:28:39 -05:00
Tomas Kopecek
86f3c5b095 decode Popen.communicate result under py3
Fixes: https://pagure.io/koji/issue/1270
2019-02-20 15:30:01 -05:00
Mike McLean
0b5a0d691f only adjust the request encoding on py3 2019-02-19 12:47:00 -05:00
Tomas Kopecek
3e595b0244 Fix non-ascii strings in xmlrpc
requests library refuse to upload non-latin-1 strings, convert data to
utf-8 before passing to library.

Fixes: https://pagure.io/koji/issue/1219
2019-02-19 12:47:00 -05:00
Yu Ming Zhu
dc208d0555 fix invokings and unittests 2019-02-17 21:26:13 -05:00
Mike McLean
b0c8f817fe drop parser option in favor of raw option 2019-02-17 21:26:13 -05:00
Yuming Zhu
eaa1b8694b docstring for read_config_files 2019-02-17 21:26:13 -05:00
Yu Ming Zhu
9ddae41877 using ConfigParser.read_file for PY3 2019-02-17 21:26:13 -05:00
Mike McLean
c2322e4f26 note origin of koji.arch and chmod -x the lib 2019-02-12 16:24:13 -05:00
Tomas Kopecek
ca86a8fa78 fix xmlrpc encoding error 2019-02-12 16:09:19 -05:00
Tomas Kopecek
ccf1c41274 fixes 2019-02-12 16:09:19 -05:00
Tomas Kopecek
009081c0fc bundle rpmUtils.arch 2019-02-12 16:09:19 -05:00
Tomas Kopecek
ed01f8d299 reorder imports 2019-02-12 16:09:19 -05:00
Tomas Kopecek
426a8c2b16 rpm builds 2019-02-12 16:06:00 -05:00
Tomas Kopecek
d3766c19b5 replace obsoleted libs 2019-02-12 16:06:00 -05:00
Tomas Kopecek
afa636264a fix import 2019-02-05 15:49:54 +01:00
Tomas Kopecek
ca29c78046 fix bytes/str in rpm header 2019-02-05 15:49:54 +01:00
Yu Ming Zhu
dc66521ceb misc changes for build and test 2019-01-28 08:46:11 -05:00
Yu Ming Zhu
30c2e5f426 sorted set in Error msgs of tasks.find_arch 2019-01-28 08:46:11 -05:00
Yu Ming Zhu
200951c9d6 fix zip for python3 2019-01-28 08:46:11 -05:00
Yu Ming Zhu
7ab1e2901d urllib fix for python3 2019-01-28 08:45:18 -05:00
Tomas Kopecek
ccdb8ac34c Use python2/3 instead of python in Makefile/spec
Fixes: https://pagure.io/koji/issue/1018
2019-01-28 06:06:50 -05:00
Adam Williamson
1b6382891c Fix is_conn_error() for Python 3.3+ change to socket.error
In Python 3.3+, `socket.error` is no longer a distinct exception.
It is - as the docs say - "A deprecated alias of OSError". This
means that this check:

`isinstance(e, socket.error)`

is effectively equivalent to:

`isinstance(e, OSError)`

This is a problem, because `requests.exceptions.ConnectionError`
(another exception type we handle later in `is_conn_error()`) is
a subclass of `OSError` - so on Python 3 we never actually reach
the block that's intended to handle that exception type. We hit
the `isinstance(e, socket.error)` block at the start instead, and
of course the exception doesn't have an `errno` attribute, so we
just return `False` at that point.

There are a few different ways we could fix this; this commit
does it by ditching the `isinstance` checks, and dropping the
shortcut `return False` bailout from the early block. We'll still
ultimately return `False` unless the error is actually one of the
other types we handle; it just costs a couple more `isinstance`
checks.

I don't think replacing the `isinstance socket.error` checks is
really necessary at all. We can just check for an `errno` attr,
and if there is one and it's one of the values we check for...
that seems safe enough to treat as a connection error.

This also changes the second check to be a check of `e2`, not
`e` - I'm *fairly* sure this is what's actually intended, and
the current code was a copy-paste error.

Fixes: #1192

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2019-01-15 11:33:14 -05:00
Mike McLean
4fa2901720 cleanup
unused var
whitespace
missing import
2019-01-15 10:51:19 -05:00
Tomas Kopecek
4191840bd7 check_sigmd5 for kojivmd 2019-01-15 10:51:19 -05:00
mprahl
5687f7bcef Don't force the Kerberos cache to be stored as a file when using the ccache kwarg on krb_login
A multi-threaded application may choose to store the Kerberos cache in the
thread keyring [1] to avoid Kerberos cache corruption. Since `krb_login` prepends
the passed in `ccache` with `FILE:`, the application must resort to setting the
`KRB_CCACHE` environment variable. This is annoying and unnecessary because
ccache defaults to `FILE` anyways if no Kerberos cache type is specified in the
value for `ccache` [2].

1 - http://man7.org/linux/man-pages/man7/thread-keyring.7.html
2 - https://web.mit.edu/kerberos/krb5-1.12/doc/basic/ccache_def.html#ccache-types
2018-12-13 12:57:45 -05:00