ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oleew...@apache.org
Subject ambari git commit: AMBARI-17344. Clear /security.json config on solr znode when kerberos is disabled. (oleewere)
Date Wed, 22 Jun 2016 09:39:18 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 15c4081fe -> 6d41fd351


AMBARI-17344. Clear /security.json config on solr znode when kerberos is disabled. (oleewere)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6d41fd35
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6d41fd35
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6d41fd35

Branch: refs/heads/trunk
Commit: 6d41fd351f1e3c35884f81fd703134fd8734efce
Parents: 15c4081
Author: oleewere <oleewere@gmail.com>
Authored: Wed Jun 22 11:29:00 2016 +0200
Committer: oleewere <oleewere@gmail.com>
Committed: Wed Jun 22 11:29:40 2016 +0200

----------------------------------------------------------------------
 .../package/scripts/setup_logsearch_solr.py     | 27 ++++++++++----------
 .../python/stacks/2.4/LOGSEARCH/test_solr.py    |  3 +++
 2 files changed, 17 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6d41fd35/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_logsearch_solr.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_logsearch_solr.py
b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_logsearch_solr.py
index 33ba70c..ff10165 100644
--- a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_logsearch_solr.py
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_logsearch_solr.py
@@ -80,20 +80,21 @@ def setup_logsearch_solr(name = None):
          )
     zk_cli_prefix = format('export JAVA_HOME={java64_home}; {cloud_scripts}/zkcli.sh -zkhost
{zookeeper_quorum}')
     create_ambari_solr_znode(zk_cli_prefix)
-    if params.logsearch_solr_ssl_enabled:
-      Execute(format('{zk_cli_prefix}{logsearch_solr_znode} -cmd clusterprop -name urlScheme
-val https'),
-              user=params.logsearch_solr_user
-              )
+
+    url_scheme = 'https' if params.logsearch_solr_ssl_enabled else 'http'
+    Execute(format('{zk_cli_prefix}{logsearch_solr_znode} -cmd clusterprop -name urlScheme
-val {url_scheme}'),
+            user=params.logsearch_solr_user)
+
+    if params.security_enabled:
+      File(format("{logsearch_solr_jaas_file}"),
+           content=Template("logsearch_solr_jaas.conf.j2"),
+           owner=params.logsearch_solr_user)
+      security_content = '\'{"authentication":{"class": "org.apache.solr.security.KerberosPlugin"}}\''
     else:
-      Execute(format('{zk_cli_prefix}{logsearch_solr_znode} -cmd clusterprop -name urlScheme
-val http'),
-              user=params.logsearch_solr_user
-              )
-      if params.security_enabled:
-        File(format("{logsearch_solr_jaas_file}"),
-             content=Template("logsearch_solr_jaas.conf.j2"),
-             owner=params.logsearch_solr_user)
-        security_content = '\'{"authentication":{"class": "org.apache.solr.security.KerberosPlugin"}}\''
-        Execute(format('{zk_cli_prefix} -cmd put {logsearch_solr_znode}/security.json ')
+ security_content)
+      security_content = '\'{}\''
+    Execute(format('{zk_cli_prefix} -cmd put {logsearch_solr_znode}/security.json ') + security_content,
+            user=params.logsearch_solr_user)
+
   elif name == 'client':
     solr_cloud_util.setup_solr_client(params.config)
     if params.security_enabled:

http://git-wip-us.apache.org/repos/asf/ambari/blob/6d41fd35/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_solr.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_solr.py b/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_solr.py
index 0474aed..0ef54f3 100644
--- a/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_solr.py
+++ b/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_solr.py
@@ -106,6 +106,9 @@ class TestSolr(RMFTestCase):
       self.assertResourceCalled('Execute', 'export JAVA_HOME=/usr/jdk64/jdk1.7.0_45; /usr/lib/ambari-logsearch-solr/server/scripts/cloud-scripts/zkcli.sh
-zkhost c6401.ambari.apache.org:2181/logsearch -cmd clusterprop -name urlScheme -val http',
                                 user = "solr"
       )
+      self.assertResourceCalled('Execute', 'export JAVA_HOME=/usr/jdk64/jdk1.7.0_45; /usr/lib/ambari-logsearch-solr/server/scripts/cloud-scripts/zkcli.sh
-zkhost c6401.ambari.apache.org:2181 -cmd put /logsearch/security.json \'{}\'',
+                                user = "solr"
+                                )
 
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/logsearch_solr.py",


Mime
View raw message