From: Ramon van Alteren Date: Tue, 7 Feb 2012 08:55:25 +0000 (+0100) Subject: Fixing parameterized job invocation X-Git-Tag: v0.2.23~308^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=83b75ee64bd737cc06f9af6f9f6c2483889c5528;p=tools%2Fpython-jenkinsapi.git Fixing parameterized job invocation It will now allow parameterized jobs to be called, with or without security token. Thanks for RBURHUM for reporting the issue. --- diff --git a/jenkinsapi/job.py b/jenkinsapi/job.py index 7adb480..9588acc 100644 --- a/jenkinsapi/job.py +++ b/jenkinsapi/job.py @@ -32,11 +32,12 @@ class Job(JenkinsBase): return self.jenkins def get_build_triggerurl( self, token=None, params={} ): - if token is None: + if token is None and not params: extra = "build" elif params: - assert isinstance(token, str ), "token if provided should be a string." - params['token'] = token + if token: + assert isinstance(token, str ), "token if provided should be a string." + params['token'] = token extra = "buildWithParameters?" + urllib.urlencode(params) else: assert isinstance(token, str ), "token if provided should be a string."