The base workflow is read from service/edp/resources/workflow.xml. This file contains (nicely formatted) xml and is used to create a base document that is extended when a workflow is generated for a job execution.
When extensions are added to the document, new elements are added without any newlines. Newlines are inserted later by doc.toprettyxml.
However, the formatting for the base elements is preserved and so doc.toprettyxml injects extra newlines for those original elements. The code that reads in the base document needs to remove the extra whitespace as the document is read from the resource file, so that the reource file can remain in human readable form but the extra newlines are not present when the extended documents are written out.
Reviewed: https:/ /review. openstack. org/64857 /git.openstack. org/cgit/ openstack/ savanna/ commit/ ?id=eee7f402fe9 1db2b8ccb824e94 347872f27fb518
Committed: https:/
Submitter: Jenkins
Branch: master
commit eee7f402fe91db2 b8ccb824e943478 72f27fb518
Author: Trevor McKay <email address hidden>
Date: Fri Jan 3 11:38:58 2014 -0500
Eliminate extra newlines in generated workflow.xml
When the base workflow in service/ edp/resources/ workflow. xml is read
newlines are preserved in the text elements. Additional elements are
added without newlines and newlines are inserted when the text is
generated. This causes extra newlines after the original elements.
This change strips whitespace from the beginning and end of each
line in the base workflow file when it is first read, which eliminates
the extra newlines in the text elements.
Closes-Bug: #1265916
Change-Id: Ibf75cdf54c3218 df9d0085005624b 3ee8d4c0ea5