Added a new method to the api for building a job with params
Job.py was modified to respond better to failures
build.py was modified to be in sync with the remove of .id() on almost
all classes
count = 0
while self.is_running():
total_wait = delay * count
- log.info("Waited %is for %s #%s to complete" % ( total_wait, self.job.id(), self.id() ) )
+ log.info("Waited %is for %s #%s to complete" % ( total_wait, self.job.name, self.name ) )
sleep( delay )
count += 1
data='')
self.poll()
return self[jobname]
+
+ def build_job(self, jobname, params={}):
+ """
+ Invoke a build by job name
+ :param jobname: name of exist job, str
+ :param params: the job params, dict
+ :return: none
+ """
+ self[jobname].invoke(params=params)
+ return
def delete_job(self, jobname):
"""
log.info( "%s is running.", self.name )
elif original_build_no < self.get_last_buildnumber():
log.info( "%s has completed.", self.name )
+ elif not response.ok :
+ response.raise_for_status()
else:
- raise AssertionError("The job did not schedule.")
+ raise AssertionError("The job did not schedule. REASON:%s" % response.reason)
def _buildid_for_type(self, buildtype):
"""Gets a buildid for a given type of build"""