Commit graph

487 commits

Author SHA1 Message Date
Tomas Kopecek
290e1ddf31 lib: more portable BadStatusLine checking
Fixes: https://pagure.io/koji/issue/2789
2021-04-13 13:26:10 +02:00
Tomas Kopecek
a7c769fd41 lib: set sinfo=None for failed ssl_login
Fixes: https://pagure.io/koji/issue/2793
2021-03-31 13:54:08 +02:00
Tomas Kopecek
32929a7916 lib: missing default values in read_config
e.g. self.opts.get('max_retries', 30) will return wrong value if there
is None as a default value.

Fixes: https://pagure.io/koji/issue/2668
2021-03-31 13:51:34 +02:00
Mike McLean
c71ebec58a Revert "requests exception"
This reverts commit ff8c13969e.

Fixes https://pagure.io/koji/issue/2786
2021-03-29 11:27:22 +02:00
Tomas Kopecek
3321abbf88 lib: more verbose conn AuthError for ssl/gssapi
Fixes: https://pagure.io/koji/issue/2502
2021-03-29 11:22:06 +02:00
Tomas Kopecek
ebdbb80e02 drop PyOpenSSL usage
We've replaced it with requests library some time ago, this code has no
better sensitivity than requests error checking, so we can drop it
completely.

Fixes: https://pagure.io/koji/issue/2752
2021-03-24 14:43:40 +01:00
Ken Dreyer
ee16954351 better ssl_login() error message when cert is None
"certification" is hard to understand. Provide a clearer error to users.
2021-02-24 14:20:16 +01:00
Yu Ming Zhu
3c4ae6e78c fix typo for kojikamid
related: #2693
fixes: #2641
2021-02-17 00:07:11 +00:00
Tomas Kopecek
13f4023bf5 flake8 fixes 2021-02-16 14:43:49 +01:00
Tomas Kopecek
c6e69b4f8b backport py27 compatible file open with encoding
client and builder needs to run on py27 which doesn't support
open(encoding='utf-8')

Related: https://pagure.io/koji/issue/2641
2021-02-16 14:13:03 +01:00
Tomas Kopecek
96ae0ecef5 explicit encoding for text file operations
Fixes: https://pagure.io/koji/issue/2641
2021-01-26 13:36:25 +01:00
Tomas Kopecek
9d64bafed6 lib: better print with debug_xmlrpc
Fixes: https://pagure.io/koji/issue/2597
2021-01-06 14:38:34 +01:00
lrossett
1c787a323f flake8 fixes 2020-12-14 13:26:00 +01:00
lrossett
ff8c13969e requests exception 2020-12-14 13:26:00 +01:00
Tomas Kopecek
0f56d39487 remove deprecated --ca option
Fixes: https://pagure.io/koji/issue/2192
2020-11-23 11:03:38 +01:00
Tomas Kopecek
2012ae64ec Revert "timezones for py 2.7"
This reverts commit a9108584b7.

Fixes: https://pagure.io/koji/issue/2568
2020-11-02 13:58:04 +01:00
Tomas Kopecek
a8d676b5a5 lib: detect non-installed rpm lib
Fixed: https://pagure.io/koji/issue/2536
2020-10-12 15:07:43 +02:00
Tomas Kopecek
a9108584b7 timezones for py 2.7 2020-10-06 15:00:23 +02:00
Tomas Kopecek
ba908fd2de report versions of components
Fixes: https://pagure.io/koji/issue/2430
2020-09-30 10:43:19 +02:00
Tomas Kopecek
7855b98ca2 formatTime/Long can handle timestamp
Also replaced *_time with *_ts wherever possible.
2020-08-26 09:26:00 +02:00
Tomas Kopecek
b0efed5e37 Fix time formatting for timezone values
Fixes: https://pagure.io/koji/issue/2423
2020-08-26 09:26:00 +02:00
Christopher O'Brien
66ec44a8f6 some safety netting 2020-08-18 16:28:01 +02:00
Christopher O'Brien
22fcdc1ad2 allow getRPMHeaders to get all headers if none are explicitly requested 2020-08-18 16:28:01 +02:00
Simo Sorce
2c663f0b73 Use requests_gssapi instead of requests_kerberos
Retain ability to use the old requests_kerberos where request_gssapi is
not available yet.

Signed-off-by: Simo Sorce <simo@redhat.com>
2020-07-24 15:32:42 -04:00
Tomas Kopecek
bbe8ce9700 backward compat wrapper for krb_login 2020-07-24 15:08:47 -04:00
Tomas Kopecek
f8419e3626 remove deprecated krbV support
Fixes: https://pagure.io/koji/issue/1991
2020-07-24 15:08:47 -04:00
Tomas Kopecek
72c701225b turn off dnf_warning in mock.cfg
Related: https://pagure.io/koji/issue/2026
2020-07-21 23:57:20 -04:00
Tomas Kopecek
50bcb6f3bc replace md5 with sha256 2020-06-24 14:42:01 +02:00
Yu Ming Zhu
a893e8bf2b a wrapper ignoring FIPS for hashlib.md5 2020-06-24 14:42:00 +02:00
Tomas Kopecek
ac38549992 make mock depsolver policy configurable
Fixes: https://pagure.io/koji/issue/826
2020-06-23 09:02:15 +02:00
Tomas Kopecek
477fb48b67 per-tag settings for mock's sign plugin
Based on amessina's patch

Fixes: https://pagure.io/koji/issue/84
2020-06-19 13:21:53 +02:00
Tomas Kopecek
1169f4be83 fix option name 2020-06-09 14:38:23 +02:00
Tomas Kopecek
d1cf0040c8 extend to allow also boostrap-image
Fixes: https://pagure.io/koji/issue/1017
2020-06-09 14:38:23 +02:00
Tomas Kopecek
db1110a5b9 fix flake8 issues 2020-06-05 10:58:38 +02:00
Tomas Kopecek
f69824041d fix checking signed files
Rpms which are signed with unknown key would raise an error. Ignore
checking of signing key validity.
2020-06-05 10:58:38 +02:00
Tomas Kopecek
3d698be2a7 use downloadFile for localPath and openRemoteFile 2020-06-05 10:58:38 +02:00
Tomas Kopecek
a4863c0f26 lib: check consistency of rpm from openRemoteFile
Fixes: https://pagure.io/koji/issue/2130
2020-06-05 10:58:38 +02:00
Tomas Kopecek
8ea4a7245b lib: retry openRemoteFile and check size 2020-06-05 10:58:38 +02:00
Tom Stellard
afc0efb122 Support tag specific environment variables
This makes it possible to specify an environment variable for a tag
that will be used during builds. e.g.

koji edit-tag -x rpm.env.CC=clang
2020-05-27 14:28:39 +02:00
Mike McLean
d30ac98325 clarify reason for decoding in comment 2020-05-25 09:14:51 +02:00
Mike McLean
b3687f2b25 don't decode signature headers
Fixes https://pagure.io/koji/issue/2221

some headers, like sigmd5, are inherently binary
2020-05-25 09:14:51 +02:00
Alex Iribarren
2087561fe6 Correctly identify "hostname doesn't match" errors 2020-05-20 10:50:56 +02:00
Yu Ming Zhu
21ff8143c4 warning for both cli and config file option 2020-05-18 09:29:04 +02:00
Yu Ming Zhu
80cf5ac94a deprecated warning for cli option --ca as well
fixes: #2182
2020-05-18 09:29:04 +02:00
Tomas Kopecek
0e5b54f32d cli: deprecate --ca
Fixes: https://pagure.io/koji/issue/2182
2020-05-13 10:45:37 +02:00
Tomas Kopecek
0132313f92 replace logging.warn with warning
call is deprected in python 3.7

Fixes: https://pagure.io/koji/issue/2135
2020-04-22 13:47:15 +02:00
Owen W. Taylor
3227462528 koji.ClientSession: fix erroneous conversion to latin-1
For Python 3, we need to always encode what we are sending to the server as
utf-8; encoding strings that have only latin-1 as latin-1 causes us to
send something that the server can't parse. (When no encoding is specified
xmlclient.client.dumps creates an XML document with an xml declaration
for UTF-8.)
2020-03-25 09:54:11 +01:00
Ken Dreyer
19dabc0eda client: use default CA store during client auth if serverca is unset
Prior to this change, if the following conditions were true:

1) A Koji client uses SSL authentication,
2) The user does not set the "serverca" option for their profile,
3) The user does not have a "~/.koji/serverca.crt" file present,

Then Koji did not use the default CA store to validate the hub's CA.
read_defaults() was setting the "serverca" value to an empty string ""
in these cases. This led to an AuthError in ssl_login() for the empty
string:

  raise AuthError("Server CA %s doesn't exist or is not accessible" % serverca)

Update ssl_login() to ignore empty strings in this case, treating them
the same as None.

The code in _sendOneCall() already checks this value in a similar way,
with "if verify:", so we're matching that behavior here.

With this change, Koji clients will fall back to using the default CA
store.
2020-03-11 13:33:39 +01:00
Yuming Zhu
cf34706f04 use Exception instead of BaseException for bare expection 2020-03-03 21:38:22 +08:00
Yuming Zhu
2a2c5cb729 flake8: apply W rules (prefering W503) 2020-03-03 21:38:22 +08:00