Commit graph

687 commits

Author SHA1 Message Date
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
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