mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
[PR #11878/1b0b8d5c backport][stable-12] gitlab_project_variable - use find_project() for graceful error handling (#11882)
gitlab_project_variable - use find_project() for graceful error handling (#11878)
* gitlab_project_variable - use find_project() for consistent error handling
Replace the bare projects.get() call in GitlabProjectVariables.get_project()
with find_project() from module_utils/gitlab, which all other GitLab modules
already use. This ensures a graceful fail_json (with a clear error message)
when the project is not found, rather than an unhandled GitlabGetError
propagating as a module traceback.
* Add changelog fragment for PR 11878
* minor adjustment in f-string
---------
(cherry picked from commit 1b0b8d5cc1)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
bugfixes:
|
||||
- gitlab_project_variable - use ``find_project()`` from module utils for project lookup, consistent
|
||||
with all other GitLab modules in the collection
|
||||
(https://github.com/ansible-collections/community.general/issues/3157,
|
||||
https://github.com/ansible-collections/community.general/pull/11878).
|
||||
Reference in New Issue
Block a user