Commit graph

699 commits

Author SHA1 Message Date
Yuming Zhu
7a6ebc851f improve test and clean targets in Makefiles 2019-11-27 15:42:30 +01:00
Tomas Kopecek
b35499cdb4 fix time type for restartHosts
Fixes: https://pagure.io/koji/issue/1825
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
Tomas Kopecek
8920d9d613 drop compatrequests variant 2019-11-25 11:31:08 +01:00
Patrick Uiterwijk
52f896c602 Implement openRemoteFile with requests or compatrequests
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
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
Ken Dreyer
ff93556f3e util: rename "dict" arg
dict is a built-in Python type. Don't use it as a variable name.
2019-11-19 12:37:13 +01:00
Ken Dreyer
68bcc06427 rm old test code
Some files in the tree had bits of code that you could run if you
executed the files directly as scripts. Now that we have unit tests and
the "fakehub" tool, we do not need this code.
2019-11-18 10:45:57 +01:00
Yu Ming Zhu
22951f7f9d fix typos for GenericError 2019-11-18 10:05:59 +01:00
Tomas Kopecek
ed4bd28b78 include profile name in prased config options
Fixes: https://pagure.io/koji/issue/1522
2019-11-14 09:54:21 +01:00
Tomas Kopecek
e11ad814af make rpm import optional in koji/__init__.py
Fixes: https://pagure.io/koji/issue/1772
2019-11-12 10:03:06 +01:00
Yu Ming Zhu
31a2670575 check ConfigParser object rather than config path list
fixes: #1763
2019-11-08 15:15:33 -05:00
Yu Ming Zhu
3e124f685a fix editUser api for multiple kerberos support 2019-10-15 09:16:43 +02:00
Yu Ming Zhu
ea52707f1d fix typos in auth.py 2019-10-15 09:16:43 +02: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
Tomas Kopecek
dd8fd935f4 use preferred arch if there is more options
https://pagure.io/koji/pull-request/323 introduced option to force an
arch for noarch packages. Nevertheless, it is only task architecture and
not buildroot one. So, if builder can provide more possible archs (32/64
bit), it will pick one of these randomly and can go against preferred arch.

Patch introduces "preferred_arch" option for find_arch and use the
task's one when it works with noarch rpm.

Fixes: https://pagure.io/koji/issue/789
2019-10-14 10:12:40 +02:00
Yuming Zhu
45ce49a643 fix typo in createUser 2019-10-11 14:21:46 +08:00
Yuming Zhu
7b60e0e7eb backwards compatibility for ProxyDNs change 2019-10-10 13:04:06 +00:00
Yu Ming Zhu
3b4673879b fix typo 2019-10-10 13:02:55 +00:00
Yuming Zhu
2408e86ff6 in proxyuser case, do use username rather than principal 2019-10-10 13:02:55 +00:00
Yuming Zhu
d662fb837d keep on using REMOTE_USER
and handover realm translation to auth_to_local rules in /etc/krb5.conf
2019-10-10 13:02:55 +00:00
Yu Ming Zhu
4a3dc40147 use GSS_NAME instead of REMOTE_USER for GSSAPI auth
jira: https://projects.engineering.redhat.com/browse/BST-475
2019-10-10 13:01:24 +00:00
Yu Ming Zhu
30ff46f1b0 fix error msg and regex sytax 2019-10-10 16:37:57 +02:00
Yu Ming Zhu
2034695e88 add an option to set server realm for all clients 2019-10-10 16:37:56 +02:00
Yu Ming Zhu
831f0dfdaf cli: fix moshimoshi for krbLogin 2019-10-10 16:37:56 +02:00
Yu Ming Zhu
ce8ff9068c fix table name typo 2019-10-10 16:37:56 +02:00
Yu Ming Zhu
ab37e28d4d hub: add AllowedKrbRealms option and (add|remove)UserKrbPrincipal API 2019-10-10 16:37:56 +02:00
Yu Ming Zhu
aaeb41e57b change users and krb_principal operations 2019-10-10 16:37:56 +02:00
Tomas Kopecek
327c23d072 Use bytes for debug string
Fixes: https://pagure.io/koji/issue/1656
2019-10-10 12:39:17 +02:00
Mike McLean
3354da7024 joinpath function 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
Ken Dreyer
95fcac7ca5 builder: log insufficent disk space location
When creating a builder with the default settings and a small root
partition "/", kojid will fail to come up because /var/lib/mock is on
the root partition.

Prior to this change, kojid would log a messages to the systemd journal
about the insufficent disk space, but it did not make it obvious which
directory should have more disk space. Add the buildroot location to
this log message, so the administrator can more easily understand what
to change.
2019-09-26 17:42:09 +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
Tomas Kopecek
8cc8b12a9a remove deprecated koji.util.relpath
Fixes: https://pagure.io/koji/issue/834
2019-08-12 17:59:26 -04:00
Tomas Kopecek
dfbe322222 deprecate sha1/md5_constructor from koji.util
These functions are now fully provided by hashlib. Commit removes their
usage from koji's codebase and leaves deprecation message in lib.

Final removal from lib is scheduled to 1.21.

Fixes: https://pagure.io/koji/issue/1487
2019-08-12 16:07:55 -04:00
Mike McLean
4f4a17361d some macro values should not be overridable 2019-07-15 10:40:54 -04:00
David Abdurachmanov
7e1809bafd Add support for tag/target macros for Mageia
Discussions with Son_Goku (from Mageia) on IRC revealed that they need
per tag/target macro support in Koji. We store tag macros in 'Extra Options'
and macro has to start with '%'.

Example:

    % koji taginfo f29
    Tag: f29 [11]
    Arches: riscv64
    Groups:
    Required permission: 'admin'
    Tag options:
      %mymacro : 'value123'
      %packager : 'Fedora Project RISC-V'
      mock.package_manager : 'dnf'
    [..]

Tag macros can be added using koji edit-tag.

The tag macros are allowed to overwrite macros set in koji.genMockConfig.
For example, %packager is set in koji.genMockConfig by default. The mock
configuration generated by kojid was:

    [..]
    config_opts['macros']['%_host'] = 'riscv64-koji-linux-gnu'
    config_opts['macros']['%mymacro'] = 'value123'
    config_opts['macros']['%_host_cpu'] = 'riscv64'
    config_opts['macros']['%vendor'] = 'Fedora Project'
    config_opts['macros']['%distribution'] = 'Fedora Project'
    config_opts['macros']['%_topdir'] = '/builddir/build'
    config_opts['macros']['%_rpmfilename'] = '%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm'
    config_opts['macros']['%packager'] = 'Fedora Project RISC-V'
    [..]

This two-line change was tested on Fedora RISC-V koji instance.

Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
2019-07-15 10:10:29 -04:00
Yuming Zhu
ded43dec53 cli: also load plugins from ~/.koji/plugins
- add plugin_path in koji.conf
- add `--plugin-paths` in cli arguments

fixes: #887
2019-07-11 15:18:15 -04:00
Tomas Kopecek
a5014ac29b set module_hotfixes=1 in yum.conf via tag config
New field in tag extra 'mock.yum.module_hotfixes' can be used to set
module_hotfixes=0/1 in yum.conf's inside mock's buildroots.

Fixes: https://pagure.io/koji/issue/1521
2019-07-11 15:12:47 -04:00
Mike McLean
0b92bd3d44 add debug message to new multicall to match original
Fixes https://pagure.io/koji/issue/1514
2019-06-27 10:30:20 -04:00
Tomas Kopecek
2bef7c16dc rename source_srpm to srpm 2019-06-26 09:06:48 +02:00
Tomas Kopecek
279e6533f6 rebuildSRPM task
New task rebuildSRPM for srpms uploaded to koji. If policy
'rebuild_srpm' returns True, build task will spawn rebuildSRPM task
first to recreate SRPM with updated buildroot macros, typically 'dist'.
Policy has access to same data as build_from_srpm and build_from_repo_id
policies. (user_id, source, task_id, build_tag, skip_tag, target, tag)

Fixes: https://pagure.io/koji/issue/1396
2019-06-26 09:06:48 +02:00
Mike McLean
29f62a090b update docstring 2019-06-17 10:19:12 -04:00
Mike McLean
37e8afcf8c support batch option in MultiCallSession 2019-06-17 10:19:12 -04:00
Mike McLean
64249cf753 provide multicall attribute for backwards compat 2019-06-17 10:19:12 -04:00
Mike McLean
32290e4a3e cleanup 2019-06-17 10:19:12 -04:00
Mike McLean
80a9d05d65 store args/kwargs in VirtualCall instances 2019-06-17 10:19:12 -04:00