WRONG_COMMIT_MSG = '- The commit %s tag attached does NOT exist in git tree or'\
' gerrit open change. Please make sure the commit has been '\
- 'pushed to gerrit and correct magical ref refs/for/branch.'
+ 'pushed to gerrit and correct magical ref refs/for/branch, '\
+ 'then re-submit tag.'
UNKNOWN_FORMAT_MSG = '- Unknown tag format, please follow the format '\
'submit/{version}/{date.time}.'
msg = 'The tag %s was pushed, but it was not completed because of '\
'the following reason(s):\n\n' % tag + '\n'.join(message)
- if len(message) != 1 or message[0] != UNDER_REVIEW_MSG % psr:
+ if len(message) != 1 or (message[0] != UNDER_REVIEW_MSG % psr and\
+ message[0] != WRONG_COMMIT_MSG % psr):
msg += '\n\n' + SUGGESTION
mygerrit.review(commit = psr, message = msg)