Change method name to reflect behaviour
This commit is contained in:
@@ -156,7 +156,7 @@ class Jenkins(object):
|
|||||||
self.auth = None
|
self.auth = None
|
||||||
self.crumb = None
|
self.crumb = None
|
||||||
|
|
||||||
def add_crumb(self, req):
|
def maybe_add_crumb(self, req):
|
||||||
# We don't know yet whether we need a crumb
|
# We don't know yet whether we need a crumb
|
||||||
if self.crumb is None:
|
if self.crumb is None:
|
||||||
response = self.jenkins_open(urllib2.Request(
|
response = self.jenkins_open(urllib2.Request(
|
||||||
@@ -225,7 +225,7 @@ class Jenkins(object):
|
|||||||
if self.auth:
|
if self.auth:
|
||||||
req.add_header('Authorization', self.auth)
|
req.add_header('Authorization', self.auth)
|
||||||
if add_crumb:
|
if add_crumb:
|
||||||
self.add_crumb(req)
|
self.maybe_add_crumb(req)
|
||||||
return urllib2.urlopen(req).read()
|
return urllib2.urlopen(req).read()
|
||||||
except urllib2.HTTPError, e:
|
except urllib2.HTTPError, e:
|
||||||
# Jenkins's funky authentication means its nigh impossible to
|
# Jenkins's funky authentication means its nigh impossible to
|
||||||
|
|||||||
Reference in New Issue
Block a user