From 114778dca257c9bfc95b50e0e001fdba5140ec5d Mon Sep 17 00:00:00 2001 From: Lin Yang Date: Wed, 22 Aug 2012 14:35:23 +0800 Subject: [PATCH] support light weight tag "build/*" --- submitobs.py | 2 +- submitobs_orig.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/submitobs.py b/submitobs.py index 4dc3860..63d0e78 100755 --- a/submitobs.py +++ b/submitobs.py @@ -173,7 +173,7 @@ if __name__ == '__main__': end('success') tagger = mygit.get_tag(tag) - if not tagger: + if not tagger.has_key('author') or not tagger.has_key('email'): print '\ntag %s is not annotated tag, exit now' % tag end('failure') if checktagmsg and title: diff --git a/submitobs_orig.py b/submitobs_orig.py index a5a9919..00d8978 100755 --- a/submitobs_orig.py +++ b/submitobs_orig.py @@ -156,13 +156,13 @@ if __name__ == '__main__': if GERRIT_CHANGE_NUMBER and GERRIT_CHANGE_NUMBER: print '%s %s %s,%s --message \'"%s"\'' % (GERRIT_CMD, 'review', GERRIT_CHANGE_NUMBER, GERRIT_PATCHSET_NUMBER, checktagmsg) runner.show('%s %s %s,%s --message \'"%s"\'' % (GERRIT_CMD, 'review', GERRIT_CHANGE_NUMBER, GERRIT_PATCHSET_NUMBER, checktagmsg)) - if tagger: + if tagger.has_key('author') and tagger.has_key('email'): print checktagmsg checktagmsg = 'Hi, %s,\n\n' % tagger['author'] + checktagmsg + '\n\n----------------------------------------------------------------\nAutomatically generated by backend service.\nPlease DO NOT Reply!' sendmail(title, checktagmsg, NOREPLY_EMAIL_SENDER, tagger['email']) end('success') - if tagger: + if tagger.has_key('author') and tagger.has_key('email'): msg = 'Submitter: %s <%s>\nComments: %s\nGit project: %s\nTag:%s\nCommit: %s %s' % (tagger['author'], tagger['email'], tagger['message'], GERRIT_PROJECT, tag, commitinfo['id'], commitinfo['subject']) else: msg = 'Git project: %s\nTag:%s\nCommit: %s %s' % (GERRIT_PROJECT, tag, commitinfo['id'], commitinfo['subject']) @@ -247,7 +247,7 @@ if __name__ == '__main__': # post sr info back to gerrit requrl = ' %s/request/show/%s' % (OBS_URL, newreq) - if tagger: + if tagger.has_key('author') and tagger.has_key('email'): comment = 'A SR (Submit Request) has been trigger to submit the commit to OBS %s project.\n- Submitter: %s <%s>\n- Comments: %s\n- Git project: %s\n- Tag:%s\n- Commit: %s %s\n- Request URL:%s' % (obs_dst_prj, tagger['author'], tagger['email'], tagger['message'], GERRIT_PROJECT, tag, commitinfo['id'], commitinfo['subject'], requrl) else: comment = 'A SR (Submit Request) has been trigger to submit the commit to OBS %s project.\n- Git project: %s\n- Tag:%s\n- Commit: %s %s\n- Request URL:%s' % (obs_dst_prj, GERRIT_PROJECT, tag, commitinfo['id'], commitinfo['subject'], requrl) @@ -258,7 +258,7 @@ if __name__ == '__main__': else: print 'GERRIT_CHANGE_NUMBER %s and GERRIT_CHANGE_NUMBER %s is empty.' % (GERRIT_CHANGE_NUMBER, GERRIT_CHANGE_NUMBER) - if tagger: + if tagger.has_key('author') and tagger.has_key('email'): comment = 'Hi, %s,\n\n' % tagger['author'] + comment + '\n\n----------------------------------------------------------------\nAutomatically generated by backend service.\nPlease DO NOT Reply!' sendmail('[Submit Request]: changes to %s/%s' % (obs_dst_prj, spec.name), comment, NOREPLY_EMAIL_SENDER, tagger['email']) -- 2.7.4