Description of problem: Version-Release number of selected component (if applicable): fedpkg-1.41-2.el7 How reproducible: $ fedpkg request-branch epel9 Could not execute request_branch: rsplit() takes no keyword arguments Steps to Reproduce: 1. Install latest fedpkg on RHEL7 2. Try to request epel9 branch Actual results: $ fedpkg request-branch epel9 Could not execute request_branch: rsplit() takes no keyword arguments Expected results: Expect to get epel9 branch request submitted Additional info:
The problem is python3 things in python2 code (since it is still el7). The fast fix for the issue above is just: ``` --- /usr/lib/python2.7/site-packages/fedpkg/utils.py.orig 2021-11-10 21:47:04.000000000 +0300 +++ /usr/lib/python2.7/site-packages/fedpkg/utils.py 2021-12-06 20:26:40.111785202 +0300 @@ -361,7 +361,7 @@ rv_json = rv.json() pkg_names = { # convert name-epoch:version-release.arch key to just the name - nevra.rsplit('.', maxsplit=1)[0].rsplit('-', maxsplit=2)[0] + nevra.rsplit('.', 1)[0].rsplit('-', 2)[0] # only packages from these repos are forbidden in epel for repo in ['BaseOS', 'AppStream', 'CRB'] for arch in rv_json['payload']['rpms'][repo].keys() ``` but then request-branch wrongly report about bad certificate, whereas it was just expired token. After the token is updated (manually): > $ fedpkg request-branch epel9 >Could not execute request_branch: The following error occurred while creating a new issue > in Pagure: Invalid or expired token. Please visit https://pagure.io/settings#nav-api-tab > to get or renew your API token. > For invalid or expired tokens please set a new token in your user configuration with: > > fedpkg set-pagure-token <token> > and then: > fedpkg set-pagure-token ....token.... > updating config '/home/buc/.config/rpkg/fedpkg.conf' > Could not execute set_pagure_token: argument of type 'instance' is not iterable Thus it seems there are a couple of things ported "as-is" from a new python3 code to the old el7's python2 one.
I did open a pull request for rsplit issue: https://pagure.io/fedpkg/pull-request/459 , with identical change as you described.
Well, for: > fedpkg set-pagure-token ....token.... > updating config '/home/buc/.config/rpkg/fedpkg.conf' > Could not execute set_pagure_token: argument of type 'instance' is not iterable yet another fix is needed: ``` --- /usr/lib/python2.7/site-packages/fedpkg/cli.py.orig 2021-08-25 05:52:09.000000000 +0300 +++ /usr/lib/python2.7/site-packages/fedpkg/cli.py 2021-12-07 23:33:05.201378082 +0300 @@ -1411,7 +1411,7 @@ section = "{0}.{1}".format(self.name, token_type) # add the section if it doesn't already exist - if section not in local_config: + if not local_config.has_section(section): local_config.add_section(section) # set the distgit / pagure urls as needed (might already be set) ``` after that, I can set new token and then request the needed branch from el7 system. Besides that, the url "https://pagure.io/settings/token/new" reported from the help output seems to be obsoleted. The true one is "https://pagure.io/settings#nav-api-tab" (which explains why it reported an "obsoleted certificate" in my case above -- it was just a wrong one generated from the old link).
@treydock, @dmitry Thanks for the code, I merged both of your suggestions in one commit. https://pagure.io/fedpkg/c/130e794 About links, I think both can be used and I see them as valid. In the fedpkg's code, there is only "...settings/token/new".
It could be fine for the author(s) of recent changes to examine all of them for compatibility with the old python2. I suspect it is likely that those two fixed are not the only ones. ;)
If there is a place to get the fedpkg RPM with these changes, I'd be happy to test. I'm not real familiar with how the fedpkg could be tested otherwise, I'm still somewhat new to using it.
FEDORA-EPEL-2022-dee661f2dc has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2022-dee661f2dc
FEDORA-EPEL-2022-dee661f2dc has been pushed to the Fedora EPEL 7 stable repository. If problem still persists, please make note of it in this bug report.