From 9b6a554bdfb2edc7aedf90481e643c722b17248b Mon Sep 17 00:00:00 2001 From: hyokeun Date: Tue, 4 Jul 2017 11:14:13 +0900 Subject: [PATCH] Use OBS_package name on staging OBS project If OBS_package field exists in mapping file, use this instead of spec name. Change-Id: I4a7e0b62bc254a840c5d6d9171721df6e0636351 --- job_submitobs.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/job_submitobs.py b/job_submitobs.py index 8b7e1f4..30ee169 100755 --- a/job_submitobs.py +++ b/job_submitobs.py @@ -458,9 +458,15 @@ def main(): url = 'ssh://%s:%s' % (os.getenv('GERRIT_HOSTNAME_EXTERNAL'), os.getenv('GERRIT_SSHPORT')) gerrit_project = os.getenv('GERRIT_PROJECT') + # get package name from xml files. + if obs_pkg: + package = obs_pkg + else: + #get package name from spec file name. + package = spec.name # create local package - print '\nCheckout %s/%s to local' % (obs_stg_prj, spec.name) - localpkg = obspkg.ObsPackage(tmpdir, obs_stg_prj, spec.name, \ + print '\nCheckout %s/%s to local' % (obs_stg_prj, package) + localpkg = obspkg.ObsPackage(tmpdir, obs_stg_prj, package, \ apiurl, apiuser, apipasswd) commit_msg = 'Submitter: %s <%s>\nComments: %s\nGit project: '\ '%s\nTag: %s\nCommit: %s %s' % (tagger['author'], \ @@ -469,7 +475,7 @@ def main(): # upload _service to obs try: upload_obs_service(url, gerrit_project, tag, - event['newrev'], obs_stg_prj, build, spec.name) + event['newrev'], obs_stg_prj, build, package) except UploadError, err: print err return 1 -- 2.7.4