Bug 1375930 - Do str_replace in a single pass
Summary: Do str_replace in a single pass
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-heat
Version: 10.0 (Newton)
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: rc
: 10.0 (Newton)
Assignee: Zane Bitter
QA Contact: Amit Ugol
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-14 09:17 UTC by Amit Ugol
Modified: 2016-12-14 16:01 UTC (History)
8 users (show)

Fixed In Version: openstack-heat-7.0.0-1.el7ost
Doc Type: Bug Fix
Doc Text:
Previously, the `str_replace` intrinsic function worked by calling the Python `str.replace()` method for each string to be replaced. Consequently, if the replacement text for one replacement contained another of the strings to be replaced, the replacement text itself could be replaced. The result was non-deterministic, since the replacement order was not guaranteed. Therefore users had to be careful to use techniques, such as guard characters, to ensure that there was no misinterpretation. With this update, replacements are now performed in a single pass, so only the original text is subject to replacement. As a result, the output of `str_replace` is now deterministic, and consistent with user expectations even without the use of guard characters. When keys overlap in the input, longer matches are preferred. Lexicographically smaller strings will be replaced first if there is still ambiguity.
Clone Of:
Environment:
Last Closed: 2016-12-14 16:01:48 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2016:2948 normal SHIPPED_LIVE Red Hat OpenStack Platform 10 enhancement update 2016-12-14 19:55:27 UTC
OpenStack gerrit 355583 None None None 2016-09-14 09:17:48 UTC

Description Amit Ugol 2016-09-14 09:17:49 UTC
Description of problem:
Do str_replace in a single pass, this is needed in some part to fix node naming issues in tripleo as discussed in https://bugzilla.redhat.com/show_bug.cgi?id=1353920#c20 and is used as a tracker for https://review.openstack.org/#/c/355583/ that should be merged soon.

Comment 2 Zane Bitter 2016-09-15 01:39:37 UTC
The patch merged upstream and will be in the Newton-rc1 build.

Comment 5 errata-xmlrpc 2016-12-14 16:01:48 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2016-2948.html


Note You need to log in before you can comment on or make changes to this bug.