From cb7402a816d1c8dc40323baa55853b2688008dbf Mon Sep 17 00:00:00 2001 From: ddavydov Date: Fri, 22 Aug 2014 09:39:55 -0700 Subject: Fixed kerberos request's interface --- jenkinsapi/utils/krb_requester.py | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/jenkinsapi/utils/krb_requester.py b/jenkinsapi/utils/krb_requester.py index a9c4e7a..4555249 100644 --- a/jenkinsapi/utils/krb_requester.py +++ b/jenkinsapi/utils/krb_requester.py @@ -27,17 +27,11 @@ class KrbRequester(Requester): super(KrbRequester, self).__init__(**args) self.mutual_auth = mutual_auth - def get_request_dict(self, url, params, data, headers): - req_dict = Requester( - self, - url=url, - params=params, - data=data, - headers=headers - ) - if self.mutual_auth: - auth = HTTPKerberosAuth(self.mutual_auth) - else: - auth = HTTPKerberosAuth() - req_dict['auth'] = auth - return req_dict + def get_request_dict(self, params=None, data=None, files=None, headers=None): + req_dict = super(KrbRequester, self).get_request_dict(params=params, data=data, files=files, headers=headers) + if self.mutual_auth: + auth = HTTPKerberosAuth(self.mutual_auth) + else: + auth = HTTPKerberosAuth() + req_dict['auth'] = auth + return req_dict -- cgit v1.2.3 From 73888ae418152be5ed2b2a21a50331beff089b82 Mon Sep 17 00:00:00 2001 From: ddavydov Date: Fri, 22 Aug 2014 09:56:12 -0700 Subject: Linter fixes --- jenkinsapi/utils/krb_requester.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jenkinsapi/utils/krb_requester.py b/jenkinsapi/utils/krb_requester.py index 4555249..17319a4 100644 --- a/jenkinsapi/utils/krb_requester.py +++ b/jenkinsapi/utils/krb_requester.py @@ -14,7 +14,8 @@ class KrbRequester(Requester): def __init__(self, ssl_verify=None, baseurl=None, mutual_auth=OPTIONAL): """ - :param ssl_verify: flag indicating if server certificate in HTTPS requests should be verified + :param ssl_verify: flag indicating if server certificate in HTTPS requests should be + verified :param baseurl: Jenkins' base URL :param mutual_auth: type of mutual authentication, use one of REQUIRED, OPTIONAL or DISABLED from requests_kerberos package @@ -28,7 +29,8 @@ class KrbRequester(Requester): self.mutual_auth = mutual_auth def get_request_dict(self, params=None, data=None, files=None, headers=None): - req_dict = super(KrbRequester, self).get_request_dict(params=params, data=data, files=files, headers=headers) + req_dict = super(KrbRequester, self).get_request_dict(params=params, data=data, files=files, + headers=headers) if self.mutual_auth: auth = HTTPKerberosAuth(self.mutual_auth) else: -- cgit v1.2.3