[ 
https://issues.apache.org/jira/browse/AMBARI-23745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16462820#comment-16462820
 ] 

Hudson commented on AMBARI-23745:
---------------------------------

SUCCESS: Integrated in Jenkins build Ambari-trunk-Commit #9174 (See 
[https://builds.apache.org/job/Ambari-trunk-Commit/9174/])
[AMBARI-23745] - Replace Multiple Matches Using Regex on Upgrades (github: 
[https://gitbox.apache.org/repos/asf?p=ambari.git&a=commit&h=27d5a866d03a87c200d8dc999c87d219e50bf6d8])
* (edit) ambari-server/src/main/resources/upgrade-config.xsd
* (edit) 
ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/ConfigureAction.java
* (edit) 
ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_test.xml
* (edit) 
ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/config-upgrade.xml
* (edit) 
ambari-server/src/test/java/org/apache/ambari/server/state/UpgradeHelperTest.java
* (edit) 
ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigUpgradeChangeDefinition.java


> Replace Multiple Matches Using Regex on Upgrades
> ------------------------------------------------
>
>                 Key: AMBARI-23745
>                 URL: https://issues.apache.org/jira/browse/AMBARI-23745
>             Project: Ambari
>          Issue Type: Task
>    Affects Versions: 2.7.0
>            Reporter: Jonathan Hurley
>            Assignee: Jonathan Hurley
>            Priority: Critical
>              Labels: pull-request-available
>             Fix For: 2.7.0
>
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> When upgrading from one stack to another, the {{regex-replace}} key can be 
> used to find and replace a block of text which matches a given regular 
> expression. This works by finding the literal string matching the regex and 
> turning this into a regular find/replace. 
> For example: 
> {code}
> <regex-replace find="\d-foo-\d" replace="REPLACED"/>
> {code}
> on
> {code}
> 1-foo-1
> 2-foo-2
> 3-foo-3
> {code}
> Would produce:
> {code}
> REPLACED
> 2-foo-2
> 3-foo-3
> {code}
> In order to replace all of the possible matches, we can extend the XSD of 
> {{RegexReplace}} to create multiple literal {{Replace}} instances for every 
> match.
> {code}
> <regex-replace find="\d-foo-\d" replace="" match-all="true"/>
> {code}
> Would produce:
> {code}
> REPLACED
> REPLACED
> REPLACED
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to