From 9006c8018db094eb63818f0b083b2dccce668d97 Mon Sep 17 00:00:00 2001 From: Adrian Likins Date: Thu, 28 Jul 2016 16:59:22 -0400 Subject: 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. --- source_control/github_key.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source_control') diff --git a/source_control/github_key.py b/source_control/github_key.py index 8f8279e6..3b887b85 100644 --- a/source_control/github_key.py +++ b/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): -- cgit v1.2.1