Assorted pylint fixes

This commit is contained in:
Dag Wieers 2019-02-14 21:02:27 +01:00 committed by Matt Clay
parent 8e0f95951d
commit f9ab9b4d68
65 changed files with 343 additions and 473 deletions

View file

@ -1,6 +1,6 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
@ -177,7 +177,7 @@ class GithubDeployKey(object):
if self.otp is not None:
self.headers = {"X-GitHub-OTP": self.otp}
else:
self.headers = {"Authorization": "token {}".format(self.token)}
self.headers = {"Authorization": "token {0}".format(self.token)}
def get_existing_key(self, key, title, force):
resp, info = fetch_url(self.module, self.url, headers=self.headers, method="GET")
@ -226,7 +226,7 @@ class GithubDeployKey(object):
self.module.fail_json(msg="Failed to add deploy key", http_status_code=status_code, error=err)
def remove_existing_key(self, key_id):
resp, info = fetch_url(self.module, self.url + "/{}".format(key_id), headers=self.headers, method="DELETE")
resp, info = fetch_url(self.module, self.url + "/{0}".format(key_id), headers=self.headers, method="DELETE")
status_code = info["status"]
@ -278,7 +278,7 @@ def main():
token = module.params.get('token', None)
otp = module.params.get('otp', None)
GITHUB_API_URL = "https://api.github.com/repos/{}/{}/keys".format(owner, repo)
GITHUB_API_URL = "https://api.github.com/repos/{0}/{1}/keys".format(owner, repo)
deploy_key = GithubDeployKey(module, GITHUB_API_URL, state, username, password, token, otp)