1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Use py2.4 compat string formatting in github_key (#2633)

Replace the use of python 2.6+ string .format() method
use with the python 2.4 compatible '%s' formatting to
make the github_key module py2.4 compatible.
This commit is contained in:
Adrian Likins 2016-07-28 16:59:22 -04:00 committed by Matt Clay
parent fdb8d11958
commit 292d788d09

View file

@ -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):