- Notifications
You must be signed in to change notification settings - Fork673
Open
Labels
Description
Description of the problem, including code/CLI snippet
I'm trying to delete a project push rule, but it results in a KeyError.
$ gitlab project-push-rules delete --project-id 1234Traceback (most recent call last): File"/Users/[redacted]/.local/bin/gitlab", line 8,in<module>sys.exit(main()) ^^^^^^ File"/Users/[redacted]/.local/pipx/venvs/python-gitlab/lib/python3.12/site-packages/gitlab/cli.py", line 418,in main gitlab.v4.cli.run( File"/Users/[redacted]/.local/pipx/venvs/python-gitlab/lib/python3.12/site-packages/gitlab/v4/cli.py", line 588,in run data =g_cli.run() ^^^^^^^^^^^ File"/Users/[redacted]/.local/pipx/venvs/python-gitlab/lib/python3.12/site-packages/gitlab/v4/cli.py", line 79,in runreturn getattr(self,method)() ^^^^^^^^^^^^^^^^^^^^^^^ File"/Users/[redacted]/.local/pipx/venvs/python-gitlab/lib/python3.12/site-packages/gitlab/v4/cli.py", line 181,in do_delete id = self.args.pop(self.cls._id_attr) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^KeyError: None
I can get the project push rule successfully usinggitlab -o json project-push-rules get --project-id 1234
, so the rule exists and my token works.
Expected Behavior
No error, project rule gets deleted.
Actual Behavior
KeyError. See above.
Specifications
- python-gitlab version: 4.8.0
- API version you are using (v3/v4): v4
- Gitlab server version (or gitlab.com): v17.0.2