Commit graph

127 commits

Author SHA1 Message Date
Tomas Kopecek
4c4f2c0496 fix tests 2022-11-10 11:07:03 +01:00
Jana Cupova
7897628159 Add active sessions web page
Fixes: https://pagure.io/koji/issue/3396
2022-11-10 10:17:51 +01:00
Jana Cupova
40de4f3df0 Rewrite Query DB to Processors in auth.py
Fixes: https://pagure.io/koji/issue/3559
2022-11-08 12:11:34 +01:00
Tomas Kopecek
22b781ad58 kojid: fix restartHosts on py 3.5+
Related: https://pagure.io/koji/issue/3442
2022-10-31 11:58:37 +01:00
Tomas Kopecek
2daa71614e fix tests according to pytests warnings 2022-10-24 10:40:50 +02:00
Jana Cupova
3999667a8c Fix Makefile for RHEL7 2022-10-11 14:29:05 +02:00
Jana Cupova
1cfe6538db Move database classes and functions from kojihub.py to koji/db.py
Move QueryProcessor, InsertProcessor, UpdateProcessor,
BulkInsertProcessor, _applyQueryOpts, get_event, _dml,
_fetchMulti, _fetchSingle, _singleValue, _multiRow, _singleRow

Update koji-sweep-db script to DB Processors

Fixes: https://pagure.io/koji/issue/3466
2022-10-11 14:29:05 +02:00
Jana Cupova
9287f672ee Parse_arches allows string and list of arches
Fixes: https://pagure.io/koji/issue/3434
2022-08-17 10:42:49 +02:00
Otto Urpelainen
f48d6d2b71 Add unit test for buildLabel 2022-08-01 15:33:29 +02:00
Jana Cupova
44f5ebaabb Authtype as enum and getSessionInfo prints authtype name
Fixes: https://pagure.io/koji/issue/3436
2022-07-26 14:36:00 +02:00
Tomas Kopecek
9e741bfb9e beautify logged commands issued by koji
Related: https://pagure.io/koji/issue/929
2022-07-19 13:23:57 +02:00
Tomas Kopecek
1652dcc606 improved sensitive values handling (requests/urllib3)
Related: https://pagure.io/koji/issue/3246
2022-05-16 16:19:33 +02:00
Jana Cupova
f42c1aa863 Add as_string option to showOpts for raw string or dict output
Fixes: https://pagure.io/koji/issue/3312
2022-05-03 12:47:47 +02:00
Tomas Kopecek
30af3a6bf5 fix test 2022-03-29 12:28:17 +02:00
Jana Cupova
c310d6692d Pytest instead of nose in unittest
Fixes: https://pagure.io/koji/issue/3140
2021-12-06 12:17:29 +01:00
Tomas Kopecek
09a8fd71e5 backward compatibility for older hub
use proxyauthtype only if it is explicetly requested. Older hubs
don't know this option and will refuse login attempt.
2021-11-04 12:07:05 +00:00
Tomas Kopecek
252121c11f propagate proxyauthtype in login calls 2021-11-04 12:07:05 +00:00
Tomas Kopecek
c587eb81bf Fix tests on centos 8
Fixes: https://pagure.io/koji/issue/2924
2021-06-22 13:17:10 +02:00
Jana Cupova
9541c2a173 importlib instead of imp
Fixes: https://pagure.io/koji/issue/2822
2021-06-02 11:19:33 +02:00
Jana Cupova
de008b5f27 Add kerberos debug message
Fixes: https://pagure.io/koji/issue/2063
2021-05-03 13:41:35 +02:00
Tomas Kopecek
c732f49ac8 fix tests 2021-04-26 14:43:20 +02:00
Tomas Kopecek
ef3e2cd04b lib: use parse_task_params for taskLabel
Fixes: https://pagure.io/koji/issue/2519
2021-04-26 14:43:20 +02:00
Mike McLean
362c3e5cc6 more rmtree unit tests 2021-03-18 15:46:16 +01:00
Mike McLean
08139a9e39 update unit tests 2021-03-18 15:46:16 +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
8ff5759b21 lib: better argument checking for eventFromOpts
Fixes: https://pagure.io/koji/issue/2513
2021-01-04 10:43:30 +01:00
Tomas Kopecek
b030b46f74 remove unittest2 2020-10-06 15:00:23 +02:00
Yu Ming Zhu
52a63f732d util: [rmtree] try best to catch errors for race condition
fixes: #2481

This approach is ugly, but just working.

ENOENT and ESTALE errors are catched in `chdir`, `listdir` calls to stomach the deletion by other process/thread

ENOTEMPTY is catched when calling `os.rmdir(path)` in `rmtree()` too. It happens when `path` is on an NFS like where ESTALE happens.
2020-10-05 10:14:34 +02:00
Ken Dreyer
e35b571196 util: handle ENOENT in _stripcwd() listdir loop
After we call listdir(), another thread or process might delete files
from the current directory. We cannot always expect lstat() to succeed
in a loop over the initial listdir entries.

If lstat() raises ENOENT, consider this file deleted and move on.
2020-08-27 13:36:27 +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
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
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
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
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
Tomas Kopecek
f9190657d9 Add 'target' policy
Fixes: https://pagure.io/koji/issue/1040
2020-02-11 14:30:25 +01:00
Tomas Kopecek
9e0452377f fix test 2019-11-25 11:54:18 +01:00
Tomas Kopecek
aad9fac8d9 move from urrlib.request.urlopen to requests.get
Fixes: https://pagure.io/koji/issue/1530
2019-11-25 11:31:08 +01:00
Yu Ming Zhu
f7f1c65bea raise error when config search paths is empty
also fix unittest: test_profiles

notes: since the test won't read config files anymore, lift the loop number from 20 -> 256 to increase the probability of hitting the multithread issue

fixes: #1786
2019-11-22 08:43:44 +01:00
Yuming Zhu
b2b8d5f9cc strict per item in config_files 2019-10-15 09:14:16 +02:00
Yu Ming Zhu
4c1928f377 extract read_config_files util for config parsing 2019-10-15 09:14:16 +02:00
Yu Ming Zhu
cace979532 fix unittests 2019-10-10 16:37:57 +02:00
Yuming Zhu
473bc1460b hub: [getRPMFile] add strict behavior 2019-10-10 18:18:32 +08:00
Mike McLean
f0cdeaab07 tests for joinpath 2019-10-09 08:41:15 -04:00
Yuming Zhu
2956319c39 update docstr and do not swallow other errno 2019-09-30 15:33:01 +02:00
Yu Ming Zhu
589eb2dc9c [lib] ensuredir: normalize directory and don't throw error when dir exists 2019-09-30 15:33:01 +02:00
mprahl
a552a248db Allow ClientSession objects to get cleaned up by the garbage collector
Fixes #1652
2019-09-20 11:51:44 -04:00
Tomas Kopecek
16fb3ad162 enable dnf_warning in mock config
Fixes: https://pagure.io/koji/issue/1594
2019-08-12 18:02:36 -04:00