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-17147. LogSearch: solr_cloud_util.py: OSError: [Errno 1] Operation not permitted with non-root ambari agent user (oleewere)
Date Fri, 10 Jun 2016 10:06:32 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk d169d8c5c -> 9380b2931


AMBARI-17147. LogSearch: solr_cloud_util.py: OSError: [Errno 1] Operation not permitted with
non-root ambari agent user (oleewere)


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

Branch: refs/heads/trunk
Commit: 9380b2931c1ecd45e6498c9d5acf2a1f297f8317
Parents: d169d8c
Author: oleewere <oleewere@gmail.com>
Authored: Fri Jun 10 12:00:59 2016 +0200
Committer: oleewere <oleewere@gmail.com>
Committed: Fri Jun 10 12:02:26 2016 +0200

----------------------------------------------------------------------
 .../libraries/functions/solr_cloud_util.py          | 16 +++++++---------
 .../ATLAS/0.1.0.2.3/package/scripts/metadata.py     |  4 +---
 .../0.5.0/package/scripts/setup_logsearch.py        |  3 +--
 .../0.4.0/package/scripts/setup_ranger_xml.py       |  4 +---
 4 files changed, 10 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9380b293/ambari-common/src/main/python/resource_management/libraries/functions/solr_cloud_util.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/solr_cloud_util.py
b/ambari-common/src/main/python/resource_management/libraries/functions/solr_cloud_util.py
index b099a1e..73619a3 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/solr_cloud_util.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/solr_cloud_util.py
@@ -19,6 +19,7 @@ limitations under the License.
 from resource_management.libraries.functions.default import default
 from resource_management.libraries.functions.format import format
 from resource_management.core.resources.system import Directory, Execute, File
+from resource_management.core.shell import as_user
 from resource_management.core.source import StaticFile, InlineTemplate
 
 __all__ = ["upload_configuration_to_zk", "create_collection"]
@@ -29,7 +30,7 @@ def __create_solr_cloud_cli_prefix(zookeeper_quorum, solr_znode, java64_home):
   return solr_cli_prefix
 
 def upload_configuration_to_zk(zookeeper_quorum, solr_znode, config_set, config_set_dir,
tmp_config_set_dir,
-                         java64_home, user, group, retry = 5, interval = 10):
+                         java64_home, user, retry = 5, interval = 10):
   """
   Upload configuration set to zookeeper with solrCloudCli.sh
   At first, it tries to download configuration set if exists into a temporary location, then
upload that one to
@@ -38,19 +39,17 @@ def upload_configuration_to_zk(zookeeper_quorum, solr_znode, config_set,
config_
   """
   solr_cli_prefix = __create_solr_cloud_cli_prefix(zookeeper_quorum, solr_znode, java64_home)
   Execute(format('{solr_cli_prefix} --download-config -d {tmp_config_set_dir} -cs {config_set}
-rt {retry} -i {interval}'),
-          only_if=format("{solr_cli_prefix} --check-config -cs {config_set} -rt {retry} -i
{interval}"),
-          user=user,
-          group=group
+          only_if=as_user(format("{solr_cli_prefix} --check-config -cs {config_set} -rt {retry}
-i {interval}"), user),
+          user=user
           )
 
   Execute(format(
     '{solr_cli_prefix} --upload-config -d {config_set_dir} -cs {config_set} -rt {retry} -i
{interval}'),
     not_if=format("test -d {tmp_config_set_dir}"),
-    user=user,
-    group=group
+    user=user
   )
 
-def create_collection(zookeeper_quorum, solr_znode, collection, config_set, java64_home,
user, group,
+def create_collection(zookeeper_quorum, solr_znode, collection, config_set, java64_home,
user,
                       shards = 1, replication_factor = 1, max_shards = 1, retry = 5, interval
= 10,
                       router_name = None, router_field = None):
   """
@@ -73,8 +72,7 @@ def create_collection(zookeeper_quorum, solr_znode, collection, config_set,
java
   if router_name is not None and router_field is not None:
     create_collection_cmd += format(' -rn {router_name} -rf {router_field}')
 
-  Execute(create_collection_cmd, user=user, group=group
-  )
+  Execute(create_collection_cmd, user=user)
 
 def setup_solr_client(config, user = None, group = None):
     solr_user = config['configurations']['logsearch-solr-env']['logsearch_solr_user'] if
user is None else user

http://git-wip-us.apache.org/repos/asf/ambari/blob/9380b293/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata.py
b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata.py
index 5799288..2525d9f 100644
--- a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata.py
+++ b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata.py
@@ -121,8 +121,7 @@ def upload_conf_set(config_set, random_num):
       config_set=config_set,
       tmp_config_set_dir=tmp_config_set_folder,
       java64_home=params.java64_home,
-      user=params.logsearch_solr_user,
-      group=params.logsearch_solr_group)
+      user=params.logsearch_solr_user)
 
 def create_collection(collection, config_set):
   import params
@@ -134,6 +133,5 @@ def create_collection(collection, config_set):
       config_set=config_set,
       java64_home=params.java64_home,
       user=params.logsearch_solr_user,
-      group=params.logsearch_solr_group,
       shards=params.atlas_solr_shards,
       replication_factor = params.logsearch_solr_replication_factor)

http://git-wip-us.apache.org/repos/asf/ambari/blob/9380b293/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_logsearch.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_logsearch.py
b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_logsearch.py
index 58239c7..890e8c6 100644
--- a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_logsearch.py
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_logsearch.py
@@ -98,5 +98,4 @@ def upload_conf_set(config_set, random_num):
     config_set=config_set,
     tmp_config_set_dir=tmp_config_set_folder,
     java64_home=params.java64_home,
-    user=params.logsearch_solr_user,
-    group=params.logsearch_solr_group)
+    user=params.logsearch_solr_user)

http://git-wip-us.apache.org/repos/asf/ambari/blob/9380b293/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py
b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py
index 30f9527..b86a09b 100644
--- a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py
+++ b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py
@@ -547,8 +547,7 @@ def setup_ranger_audit_solr():
     config_set_dir = params.ranger_solr_conf,
     tmp_config_set_dir = tmp_config_set_folder,
     java64_home = params.java_home,
-    user = params.unix_user,
-    group = params.unix_group)
+    user = params.unix_user)
 
   solr_cloud_util.create_collection(
     zookeeper_quorum = params.zookeeper_quorum,
@@ -557,6 +556,5 @@ def setup_ranger_audit_solr():
     config_set = params.ranger_solr_config_set,
     java64_home = params.java_home,
     user = params.unix_user,
-    group = params.unix_group,
     shards = params.ranger_solr_shards,
     replication_factor = params.replication_factor)


Mime
View raw message