From 1159193d16f361b801c15f212ab6a16ab27b8dcd Mon Sep 17 00:00:00 2001 From: Guillaume Martinez Date: Fri, 10 Jan 2020 23:15:26 +0100 Subject: [PATCH] [Backport 2.9] gitlab_runner: fix idempotency for shared runners (#65545) * gitlab_runner: fix idempotency for shared runners (#65176) (cherry picked from commit 2eb615f1effed2f10cefeb73bd374a9c00fba061) * add changelog --- changelogs/fragments/65176-gitlab-runner-idempotency.yaml | 2 ++ lib/ansible/modules/source_control/gitlab_runner.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 changelogs/fragments/65176-gitlab-runner-idempotency.yaml diff --git a/changelogs/fragments/65176-gitlab-runner-idempotency.yaml b/changelogs/fragments/65176-gitlab-runner-idempotency.yaml new file mode 100644 index 00000000000..5570d75cbf3 --- /dev/null +++ b/changelogs/fragments/65176-gitlab-runner-idempotency.yaml @@ -0,0 +1,2 @@ +bugfixes: + - gitlab_runner - fix idempotency for shared runner diff --git a/lib/ansible/modules/source_control/gitlab_runner.py b/lib/ansible/modules/source_control/gitlab_runner.py index c8ecad590e1..7a92c8992b2 100644 --- a/lib/ansible/modules/source_control/gitlab_runner.py +++ b/lib/ansible/modules/source_control/gitlab_runner.py @@ -258,10 +258,10 @@ class GitLabRunner(object): @param description Description of the runner ''' def findRunner(self, description): - runners = self._gitlab.runners.list(as_list=False) + runners = self._gitlab.runners.all(as_list=False) for runner in runners: - if (runner.description == description): - return self._gitlab.runners.get(runner.id) + if (runner['description'] == description): + return self._gitlab.runners.get(runner['id']) ''' @param description Description of the runner