gvalkov / jenkins-webapi

Python library for interacting with jenkins ci
http://jenkins-webapi.rtfd.org/
Other
16 stars 14 forks source link

Fix wrong parameter type of Jenkins.build() #22

Closed yanqd0 closed 7 years ago

yanqd0 commented 7 years ago

The original implementation (v0.5.3) of Jenkins.build() has an obvious bug. When invoked (in IPython), there would be error information like this:

/home/yanqd0/jenkins/jenkins-webapi/jenkins.py in build(self, name, number)
    657     def build(self, name, number):
    658         name = name.name if isinstance(name, Job) else name
--> 659         return Build(name, number)
    660 
    661     def node(self, name):

/home/yanqd0/jenkins/jenkins-webapi/jenkins.py in __init__(self, job, number)
    457         self.job = job
    458         self.number = number
--> 459         self.server = self.job.server
    460 
    461     def __hash__(self):

AttributeError: 'str' object has no attribute 'server'
gvalkov commented 7 years ago

Thanks for the fix. It's available in jenkins-webapi 0.5.4 :+1: