releasetools: Consolidate the conditions

Change-Id: Idf2288c476e0a9c299a5058cbd3268e7c670fca1
(cherry picked from commit 77305f69d59bda9af6d53b8b2fd4f2aac95520e1)