From 59ed4fc07947d80352f1656c5d8a280cddec8b0f Mon Sep 17 00:00:00 2001 From: Peter Mosmans Date: Tue, 31 May 2016 12:10:02 +1000 Subject: [PATCH 1/2] Added HTTPauth support for even more methods :) --- gitlab/__init__.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/gitlab/__init__.py b/gitlab/__init__.py index 90ffa5090..28c5a17a4 100644 --- a/gitlab/__init__.py +++ b/gitlab/__init__.py @@ -529,7 +529,10 @@ def delete(self, obj, id=None, **kwargs): params=params, headers=headers, verify=self.ssl_verify, - timeout=self.timeout) + timeout=self.timeout, + auth=requests.auth.HTTPBasicAuth( + self.http_username, + self.http_password)) except Exception as e: raise GitlabConnectionError( "Can't connect to GitLab server (%s)" % e) @@ -576,7 +579,10 @@ def create(self, obj, **kwargs): r = self.session.post(url, data=data, headers=headers, verify=self.ssl_verify, - timeout=self.timeout) + timeout=self.timeout, + auth=requests.auth.HTTPBasicAuth( + self.http_username, + self.http_password)) except Exception as e: raise GitlabConnectionError( "Can't connect to GitLab server (%s)" % e) @@ -626,7 +632,10 @@ def update(self, obj, **kwargs): r = self.session.put(url, data=data, headers=headers, verify=self.ssl_verify, - timeout=self.timeout) + timeout=self.timeout, + auth=requests.auth.HTTPBasicAuth( + self.http_username, + self.http_password)) except Exception as e: raise GitlabConnectionError( "Can't connect to GitLab server (%s)" % e) From 40d796988171967570d485d7ab709ad6ea466ecf Mon Sep 17 00:00:00 2001 From: Peter Mosmans Date: Tue, 31 May 2016 12:15:11 +1000 Subject: [PATCH 2/2] pylint fix --- gitlab/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitlab/__init__.py b/gitlab/__init__.py index 28c5a17a4..c42acaf46 100644 --- a/gitlab/__init__.py +++ b/gitlab/__init__.py @@ -581,8 +581,8 @@ def create(self, obj, **kwargs): verify=self.ssl_verify, timeout=self.timeout, auth=requests.auth.HTTPBasicAuth( - self.http_username, - self.http_password)) + self.http_username, + self.http_password)) except Exception as e: raise GitlabConnectionError( "Can't connect to GitLab server (%s)" % e)