JJB init script: Remove superfluous lines from autogenerated files 18/20718/4
authorVratko Polak <vrpolak@cisco.com>
Tue, 19 May 2015 11:59:58 +0000 (13:59 +0200)
committerVratko Polak <vrpolak@cisco.com>
Tue, 19 May 2015 14:46:30 +0000 (16:46 +0200)
Change-Id: I85f59b1c72a9d471c460f4d0e63177cb959f2fef
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
scripts/jjb-init-project.py

index ef7ec41a0e69754590af61606b6d2dd28e19b8d1..f5608d198109bf6178391377fd75d50b22eb6952 100644 (file)
@@ -194,5 +194,8 @@ with open(project_file, "w") as outfile:
                     line = re.sub("EMAIL_PREFIX", email_prefix, line)
                     line = re.sub("SONAR_BRANCH", sonar_branch, line)
                     line = re.sub("ARCHIVE_ARTIFACTS", archive_artifacts, line)
+                    # The previous command may have created superfluous lines.
+                    # If a line has no non-whitespace, it has to be '\n' only.
+                    line = re.sub(r'^\s+\n', "", line)
                 outfile.write(line)
         outfile.write("\n")