Merge "Check for migration branch dir"

This commit is contained in:
Jenkins 2016-01-06 17:17:10 +00:00 committed by Gerrit Code Review
commit b36df68039

View File

@ -139,8 +139,12 @@ def get_branch(release, revision, library_path, project):
migration_dir = os.path.join(
get_abs_path(migrations_dir), branch
)
# If a release has no migrations for a given branch, the branch
# directory will not exist.
if os.path.isdir(migration_dir):
for file in os.listdir(migration_dir):
if file.endswith('.py') and file.split('_')[0] == revision:
if (file.endswith('.py') and
file.split('_')[0] == revision):
return branch