Fix the debug of uploading service file is failed to a linked
authorZhuoX Li <zhuox.li@intel.com>
Wed, 4 Jun 2014 10:46:52 +0000 (18:46 +0800)
committerLin Yang <lin.a.yang@intel.com>
Thu, 5 Jun 2014 04:08:18 +0000 (12:08 +0800)
one example shows as below:
When the Tizen:Mobile:build OBS project links the Tizen:Mobile,
we can get the package meta by Tizen:Mobile:build, but the package isn't
in the Tizen:Mobile:build, so the package of _service file can't be uploaded.
Before uploading, we should check it.

Fixes: #1944

Change-Id: I676525a26e8bfa5b382b4bffffd97a39f2e7d4a8

job_submitobs.py

index 6ed4432..2c8d0bb 100755 (executable)
@@ -468,6 +468,14 @@ def main():
                 url = 'ssh://%s:%s' % (os.getenv('GERRIT_HOSTNAME'),
                                     os.getenv('GERRIT_SSHPORT'))
                 gerrit_project = os.getenv('GERRIT_PROJECT')
+                # create local package
+                print '\nCheckout %s/%s to local' % (obs_stg_prj, spec.name)
+                localpkg = obspkg.ObsPackage(tmpdir, obs_stg_prj, spec.name, \
+                        apiurl, apiuser, apipasswd)
+                commit_msg = 'Submitter: %s <%s>\nComments: %s\nGit project: '\
+                        '%s\nTag: %s\nCommit: %s %s' % (tagger['author'], \
+                        tagger['email'], tagger['message'], event['project'], \
+                        tag, commitinfo['id'], commitinfo['subject'])
                 # upload _service to obs
                 try:
                     upload_obs_service(url, gerrit_project, tag,
@@ -476,13 +484,6 @@ def main():
                     print err
                     return 1
 
-                print '\nCheckout %s/%s to local' % (obs_stg_prj, spec.name)
-                localpkg = obspkg.ObsPackage(tmpdir, obs_stg_prj, spec.name, \
-                        apiurl, apiuser, apipasswd)
-                commit_msg = 'Submitter: %s <%s>\nComments: %s\nGit project: '\
-                        '%s\nTag: %s\nCommit: %s %s' % (tagger['author'], \
-                        tagger['email'], tagger['message'], event['project'], \
-                        tag, commitinfo['id'], commitinfo['subject'])
                 # create SR
                 status = True
                 if obs_stg_prj != obs_dst_prj: