diff --git a/changelogs/fragments/7375-fix-github-deploy-key-pagination.yml b/changelogs/fragments/7375-fix-github-deploy-key-pagination.yml new file mode 100644 index 0000000000..c95da981c6 --- /dev/null +++ b/changelogs/fragments/7375-fix-github-deploy-key-pagination.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - "github_deploy_key - fix pagination behaviour causing a crash when only a single page of deploy keys exist (https://github.com/ansible-collections/community.general/pull/7375)." \ No newline at end of file diff --git a/plugins/modules/github_deploy_key.py b/plugins/modules/github_deploy_key.py index b65f635801..ae90e04c91 100644 --- a/plugins/modules/github_deploy_key.py +++ b/plugins/modules/github_deploy_key.py @@ -227,7 +227,7 @@ class GithubDeployKey(object): yield self.module.from_json(resp.read()) links = {} - for x, y in findall(r'<([^>]+)>;\s*rel="(\w+)"', info["link"]): + for x, y in findall(r'<([^>]+)>;\s*rel="(\w+)"', info.get("link", '')): links[y] = x url = links.get('next')