Repository: ambari Updated Branches: refs/heads/branch-2.5 c4f071be2 -> de227f6d1
AMBARI-20257 Log Search upgrade to 2.5 should handle renamed properties safely (mgergely) Change-Id: I35385a0bf3d596bea864767a04ea8d930404e7de Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/de227f6d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/de227f6d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/de227f6d Branch: refs/heads/branch-2.5 Commit: de227f6d1f99212bfd131af6ce44dff6c2ce59b6 Parents: c4f071b Author: Miklos Gergely <[email protected]> Authored: Fri Mar 3 01:39:28 2017 +0100 Committer: Miklos Gergely <[email protected]> Committed: Fri Mar 3 01:39:28 2017 +0100 ---------------------------------------------------------------------- .../org/apache/ambari/server/upgrade/UpgradeCatalog250.java | 9 ++++++--- .../LOGSEARCH/0.5.0/configuration/logsearch-properties.xml | 6 +++--- 2 files changed, 9 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/de227f6d/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java index a597a63..c67e80d 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java @@ -887,9 +887,12 @@ public class UpgradeCatalog250 extends AbstractUpgradeCatalog { Config logSearchProperties = cluster.getDesiredConfigByType("logsearch-properties"); if (logSearchProperties != null) { Map<String, String> newProperties = new HashMap<>(); - newProperties.put("logsearch.auth.external_auth.enabled", logSearchProperties.getProperties().get("logsearch.external.auth.enabled")); - newProperties.put("logsearch.auth.external_auth.host_url", logSearchProperties.getProperties().get("logsearch.external.auth.host_url")); - newProperties.put("logsearch.auth.external_auth.login_url", logSearchProperties.getProperties().get("logsearch.external.auth.login_url")); + if (!logSearchProperties.getProperties().containsKey("logsearch.auth.external_auth.enabled")) + newProperties.put("logsearch.auth.external_auth.enabled", logSearchProperties.getProperties().get("logsearch.external.auth.enabled")); + if (!logSearchProperties.getProperties().containsKey("logsearch.auth.external_auth.host_url")) + newProperties.put("logsearch.auth.external_auth.host_url", logSearchProperties.getProperties().get("logsearch.external.auth.host_url")); + if (!logSearchProperties.getProperties().containsKey("logsearch.auth.external_auth.login_url")) + newProperties.put("logsearch.auth.external_auth.login_url", logSearchProperties.getProperties().get("logsearch.external.auth.login_url")); Set<String> removeProperties = new HashSet<>(); removeProperties.add("logsearch.external.auth.enabled"); http://git-wip-us.apache.org/repos/asf/ambari/blob/de227f6d/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-properties.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-properties.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-properties.xml index d57b98b..a18c5c5 100644 --- a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-properties.xml +++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-properties.xml @@ -157,21 +157,21 @@ <value-attributes> <type>boolean</type> </value-attributes> - <on-ambari-upgrade add="true"/> + <on-ambari-upgrade add="false"/> </property> <property> <name>logsearch.auth.external_auth.host_url</name> <value>{ambari_server_auth_host_url}</value> <display-name>External authentication url - host and port</display-name> <description>The host and port of the external server used to authenticate</description> - <on-ambari-upgrade add="true"/> + <on-ambari-upgrade add="false"/> </property> <property> <name>logsearch.auth.external_auth.login_url</name> <value>/api/v1/users/$USERNAME/privileges?fields=*</value> <display-name>External authentication url - path and query</display-name> <description>The path and query of the external server used to authenticate</description> - <on-ambari-upgrade add="true"/> + <on-ambari-upgrade add="false"/> </property> <property> <name>logsearch.roles.allowed</name>
