Commit graph

3843 commits

Author SHA1 Message Date
Yu Ming Zhu
dc66521ceb misc changes for build and test 2019-01-28 08:46:11 -05:00
Yuming Zhu
fa5ccf0eac using explicit coverage2/3 in Makefile 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
eb36620aa3 fix some unittests 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
Mike McLean
708ded8138 PR#1062: fix pyOpenSSL dependency for py26 in setup.py
Merges #1062
https://pagure.io/koji/pull-request/1062

Fixes: #1060
https://pagure.io/koji/issue/1060
pyopenssl 18.0.0 has dropped Python 2.6 support
2019-01-28 06:16:46 -05:00
Yuming Zhu
8586a227c6 fix pyOpenSSL dependency for py26 in setup.py 2019-01-28 06:16:35 -05:00
Mike McLean
e10daecd2b PR#1019: Use python2/3 instead of python in Makefile/spec
Merges #1019
https://pagure.io/koji/pull-request/1019

Fixes: #1018
https://pagure.io/koji/issue/1018
rpms can't be built in Fedora rawhide
2019-01-28 06:07:02 -05:00
Tomas Kopecek
b2230b9510 set default python 2019-01-28 06:06:50 -05:00
Franz Chih-Ping Hsieh
42f5988dc3 use macro to support RHEL8 build
Related: #986
2019-01-28 06:06:50 -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
Mike McLean
c203afe7c2 PR#1190: hub: document all edit_tag arguments
Merges #1190
https://pagure.io/koji/pull-request/1190
2019-01-15 12:03:00 -05:00
Ken Dreyer
21e837db3e hub: document all edit_tag arguments
Reformat the description of the editTag2 RPC to Sphinx's doc format,
filling in the missing data types.
2019-01-15 12:02:55 -05:00
Mike McLean
822311fb56 PR#1201: re-add urlparse import in kojikamid
Merges #1201
https://pagure.io/koji/pull-request/1201
2019-01-15 11:42:32 -05:00
Mike Bonnet
6bdb18e26f re-add import removed by 921258749a
kojikamid has code from other files substituted into it, to reduce
copy-paste. In this case, the SCM class from koji/daemon.py
requires the urlparse module.
2019-01-15 11:42:21 -05:00
Mike McLean
a224695d1c PR#1203: Fix is_conn_error() for Python 3.3+ change to socket.error
Merges #1203
https://pagure.io/koji/pull-request/1203

See also: https://bugzilla.redhat.com/show_bug.cgi?id=1609298
2019-01-15 11:33:19 -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
6cce316ff9 PR#967: use correct fileinfo checksum field
Merges #967
https://pagure.io/koji/pull-request/967

Fixes: #966
https://pagure.io/koji/issue/966
kojikamid makes wrong md5sum check
2019-01-15 10:53:49 -05:00
Mike McLean
8a36479cdb fix undefined var 2019-01-15 10:51:19 -05:00
Mike McLean
4fa2901720 cleanup
unused var
whitespace
missing import
2019-01-15 10:51:19 -05:00
Mike McLean
c60ec3c2f3 add a unit test 2019-01-15 10:51:19 -05:00
Tomas Kopecek
4191840bd7 check_sigmd5 for kojivmd 2019-01-15 10:51:19 -05:00
Tomas Kopecek
28ce53afc3 use correct fileinfo checksum field
Fixes: https://pagure.io/koji/issue/966
2019-01-15 10:51:19 -05:00
Mike McLean
f04346e43f PR#1187: Add ctx option to ClientSession.krb_login()
Merges #1187
https://pagure.io/koji/pull-request/1187
2019-01-15 10:48:31 -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
mprahl
4b6c92045f Add a ctx kwarg to ClientSession.krb_login
Before this change, `koji.ClientSession.krb_login` always used the
default context. This can be an issue when a multi-threaded application
shares this context and the Kerberos cache is stored in the thread keyring.
In this scenario, the first thread to run `krb_login` will succeed while
all others will get a "Permission denied" error. By adding the `ctx` kwarg,
a thread can establish a context and tell `krb_login` to use it instead of
the default context.
2018-12-13 12:49:38 -05:00
Mike McLean
2b8a9dd573 PR#1175: kojira: avoid race condition that causes "unknown task" errors
Merges #1175
https://pagure.io/koji/pull-request/1175

Fixes: #942
https://pagure.io/koji/issue/942
kojira: Needed tag refers to unknown task
2018-12-04 22:53:58 -05:00
Mike McLean
11a1c7beed make recent_tasks lifetime configurable 2018-12-04 22:53:52 -05:00
Mike McLean
3f0a2952ee don't iterate over the dict we are changing 2018-12-04 22:53:52 -05:00
Mike McLean
fea969e91b kojira: avoid race condition that causes "unknown task" errors 2018-12-04 22:53:52 -05:00
Mike McLean
f71804d039 PR#964: few sort speedups
Merges #964
https://pagure.io/koji/pull-request/964

Fixes: #963
https://pagure.io/koji/issue/963
Speedup sorts
2018-12-04 00:05:32 -05:00
Tomas Kopecek
17db100db5 few sort speedups
Fixes: https://pagure.io/koji/issue/963
2018-12-04 00:05:26 -05:00
Mike McLean
088d500e0e PR#852: drop encode_int helper
Merges #852
https://pagure.io/koji/pull-request/852

Fixes: #750
https://pagure.io/koji/issue/750
Drop use of encode_int on hub
2018-12-03 23:55:45 -05:00
Tomas Kopecek
f4ee150026 drop encode_int helper
We're already using i8 encoding mechanism, so this function is no more
needed.

Fixes: https://pagure.io/koji/issue/750
2018-12-03 23:55:39 -05:00
Mike McLean
ecfcb5b935 PR#1043: remove old messagebus plugin
Merges #1043
https://pagure.io/koji/pull-request/1043

Fixes: #878
https://pagure.io/koji/issue/878
Deprecate old messagebus plugin
2018-12-03 23:49:44 -05:00
Tomas Kopecek
3e37644f25 remove old messagebus plugin
There is no more known user. If you need messaging functionality, you
could migrate to protonmsg plugin.

Fixes: https://pagure.io/koji/issue/878
2018-12-03 23:49:37 -05:00
Mike McLean
d424fb085b PR#1176: kojid: implement task_avail_delay check
Merges #1176
https://pagure.io/koji/pull-request/1176

Relates: #340
https://pagure.io/koji/issue/340
koji doesn't take plugins into account when median capacity is calculated
2018-12-03 15:54:20 -05:00
Mike McLean
cc7afa1b17 more tests and another fix 2018-12-03 15:54:07 -05:00
Mike McLean
beac7899ec partial unit test with minor fix 2018-12-03 15:54:07 -05:00
Mike McLean
25d8e41f31 cleanup 2018-12-03 15:54:07 -05:00
Mike McLean
2ab6a6eff0 initialize TaskManager.skipped_tasks 2018-12-03 15:54:07 -05:00
Mike McLean
586e23f228 allow setting task_avail_delay in kojid.conf 2018-12-03 15:54:07 -05:00
Mike McLean
c3b7c815cb add a timeout for skipping a task based on bin capacity 2018-12-03 15:54:07 -05:00
Mike McLean
06953ffba1 PR#1180: Update source when recycling build
Merges #1180
https://pagure.io/koji/pull-request/1180

Fixes: #1179
https://pagure.io/koji/issue/1179
Stale source field of recycled builds
2018-12-03 15:33:31 -05:00
Mike McLean
a3643f7b64 fix unit test 2018-12-03 15:31:37 -05:00
Mike McLean
98bffbad11 also set extra and volume_id in recycle_build 2018-12-03 15:20:09 -05:00
Mikolaj Izdebski
f8d2f4395e Update source when recycling build
Fixes: #1179
2018-12-03 15:20:09 -05:00
Mike McLean
91a4011e3a PR#1178: cli: document parse_arches method parameters
Merges #1178
https://pagure.io/koji/pull-request/1178
2018-11-30 15:23:16 -06:00
Ken Dreyer
9fe61b561f cli: document parse_arches method parameters
Document the parameters for the parse_arches method.
2018-11-29 08:22:13 -07:00