diff --git a/lib/ansible/modules/extras/source_control/github_key.py b/lib/ansible/modules/extras/source_control/github_key.py index 8f8279e6e6..3b887b8537 100644 --- a/lib/ansible/modules/extras/source_control/github_key.py +++ b/lib/ansible/modules/extras/source_control/github_key.py @@ -99,7 +99,7 @@ class GitHubSession(object): def request(self, method, url, data=None): headers = { - 'Authorization': 'token {}'.format(self.token), + 'Authorization': 'token %s' % self.token, 'Content-Type': 'application/json', 'Accept': 'application/vnd.github.v3+json', } @@ -147,7 +147,7 @@ def delete_keys(session, to_delete, check_mode): return for key in to_delete: - session.request('DELETE', API_BASE + '/user/keys/{[id]}'.format(key)) + session.request('DELETE', API_BASE + '/user/keys/%s' % key[id]) def ensure_key_absent(session, name, check_mode):