From 03cfb030686a401edb4130f492c854b15d60a1d2 Mon Sep 17 00:00:00 2001 From: Lin Yang Date: Mon, 11 Nov 2013 22:08:24 +0800 Subject: [PATCH] Check whether need to sync project to inside obs For sync instance, need to check whether this project match the regular expression in jobs/configuration to sync this submission to inside obs. Fixes: #1426 Change-Id: Ide8addde38a40dab1487d7d97f1a477dc6dbdbff Signed-off-by: Lin Yang --- job_submitobs.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/job_submitobs.py b/job_submitobs.py index de66953..f17dc48 100755 --- a/job_submitobs.py +++ b/job_submitobs.py @@ -303,6 +303,13 @@ def main(): print '\nREFNAME "%s" is deleted, exit now' % event['refname'] return 0 + if os.getenv('SYNC_GERRIT_PROJECT_PATTERN'): + # check whether need to sync this project to inside obs + r = re.compile(os.getenv('SYNC_GERRIT_PROJECT_PATTERN')) + if not r.match(event['project']): + print 'Do not need to sync project %s, exit now' % event['project'] + return 0 + obs_mapping = '%s/%s/git-obs-mapping.xml' % (gitcache, mapping_prj) # check whether git-obs-mapping.xml exist in local if not os.path.isfile(obs_mapping): -- 2.7.4