TT#26827 Release panel triggers jenkins jobs with branch=none

Attempt to fix problem when release panel triggers jenkins jobs
setting branch=none when tag=mrX.X.X.1, when the branch parameter
should have branch=mrX.X.X

A change from string.join() to "".join() is needed for Python 3.

Change-Id: I89f7bb304180880bc7317b61aa675b8d2162f091
changes/43/17643/1
Manuel Montecelo 7 years ago
parent afc971fd87
commit a3bcf7f358

@ -14,7 +14,6 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
import string
import urllib
import uuid
from django.conf import settings
@ -50,7 +49,7 @@ def trigger_build(project, release_uuid, trigger_release=None,
# branch is like tag but removing the last element,
# e.g. tag=mr5.5.2.1 -> branch=mr5.5.2
branch = string.join(tag.split(".")[0:-1], ".")
branch = ".".join(tag.split(".")[0:-1])
params['branch'] = urllib.parse.quote(branch)
elif trigger_branch_or_tag.startswith("branch/"):
branch = trigger_branch_or_tag.split("branch/")[1]

@ -14,7 +14,6 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
import string
import uuid
import urllib
import requests
@ -89,7 +88,7 @@ def trigger_build(project, trigger_release=None,
# branch is like tag but removing the last element,
# e.g. tag=mr5.5.2.1 -> branch=mr5.5.2
branch = string.join(tag.split(".")[0:-1], ".")
branch = ".".join(tag.split(".")[0:-1])
params['branch'] = urllib.parse.quote(branch)
elif trigger_branch_or_tag.startswith("branch/"):
branch = trigger_branch_or_tag.split("branch/")[1]

Loading…
Cancel
Save