Re-implement NetworkTemplate to use regex directly
NetworkTemplate behaves wrong way in case we don't pass a substituation
value or when closing pattern doesn't fit '%>' (check fixed tests). The
main reason is that `string.Template` is designed to match delimeter
based patterns, not braced ones. By some accident, the `string.Template`
implementation is broken in both Python 2.6 and Python 2.7.6, and it's
fixed for sure in Python 2.7.10 (because tests start to fail).
Let's re-write our NetworkImplementation in order to have proper
behaviour, and make tests to pass on various Py2 versions regardless of
minor versions.
Closes-Bug: #1500869
Change-Id: I3f6e1cb7fb50ab9d3a47256b3e7e718b4f01e153
Signed-off-by: Igor Kalnitsky <email address hidden>
Reviewed: https:/ /review. openstack. org/229011 /git.openstack. org/cgit/ stackforge/ fuel-web/ commit/ ?id=180a39eae65 300144a8f0a41e3 35b0845570d88b
Committed: https:/
Submitter: Jenkins
Branch: master
commit 180a39eae653001 44a8f0a41e335b0 845570d88b
Author: Igor Kalnitsky <email address hidden>
Date: Tue Sep 29 18:15:05 2015 +0300
Re-implement NetworkTemplate to use regex directly
NetworkTemplate behaves wrong way in case we don't pass a substituation
value or when closing pattern doesn't fit '%>' (check fixed tests). The
main reason is that `string.Template` is designed to match delimeter
based patterns, not braced ones. By some accident, the `string.Template`
implementation is broken in both Python 2.6 and Python 2.7.6, and it's
fixed for sure in Python 2.7.10 (because tests start to fail).
Let's re-write our NetworkImplemen tation in order to have proper
behaviour, and make tests to pass on various Py2 versions regardless of
minor versions.
Closes-Bug: #1500869
Change-Id: I3f6e1cb7fb50ab 9d3a47256b3e7e7 18b4f01e153
Signed-off-by: Igor Kalnitsky <email address hidden>