Catch buildservice ObsError exception
authorZhuoX Li <zhuox.li@intel.com>
Wed, 19 Mar 2014 05:50:28 +0000 (13:50 +0800)
committerLin A Yang <lin.a.yang@intel.com>
Mon, 31 Mar 2014 03:33:12 +0000 (06:33 +0300)
When modify the meta conf to unlink raise ObsError exception,
it should be catched.

Fixes: #1726

Change-Id: Icf7602ba813db5a3c0ca9ead4171dd2072b767d5

job_submit.py

index f3aee9a..eecd50d 100755 (executable)
@@ -67,7 +67,10 @@ def create_project(git_url, git_project, git_tag, git_revision, build,
         # update project info
         build.update_info(info, obs_project)
         # unlink the project to upload packages
-        build.unlink_project(obs_project)
+        try:
+            build.unlink_project(obs_project)
+        except ObsError, error:
+            print 'Modify the meta conf to unlink failed: %s' % error
     else:
         if not build.exists(obs_target_prj):
             raise LocalError("Target project %s doesn't exist" % obs_target_prj)