You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2016/08/01 11:55:22 UTC

[1/2] ambari git commit: AMBARI-17973. Zeppelin start fails in non-root (aonishuk)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 d0a5ab073 -> 4b0a61ae2
  refs/heads/trunk fc09b63b3 -> 24dcece8e


AMBARI-17973. Zeppelin start fails in non-root (aonishuk)


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

Branch: refs/heads/trunk
Commit: 24dcece8e2677a4c3531293316b3cd8709a21dfd
Parents: fc09b63
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Mon Aug 1 14:55:10 2016 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Mon Aug 1 14:55:10 2016 +0300

----------------------------------------------------------------------
 .../ZEPPELIN/0.6.0.2.5/package/scripts/master.py  | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/24dcece8/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
index 531e613..4202c0c 100644
--- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
+++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
@@ -23,6 +23,9 @@ import os
 from resource_management.core.resources import Directory
 from resource_management.core.resources.system import Execute, File
 from resource_management.core.source import InlineTemplate
+from resource_management.core import sudo
+from resource_management.core.logger import Logger
+from resource_management.core.source import StaticFile
 from resource_management.libraries import XmlConfig
 from resource_management.libraries.functions.check_process_status import check_process_status
 from resource_management.libraries.functions.format import format
@@ -127,14 +130,12 @@ class Master(Script):
          owner=params.zeppelin_user, group=params.zeppelin_group)
 
     # copy hive-site.xml
-    hive_site_xml_content = open("/etc/spark/conf/hive-site.xml").read()
-    File(format("{params.conf_dir}/hive-site.xml"), content=hive_site_xml_content,
+    File(format("{params.conf_dir}/hive-site.xml"), content=StaticFile("/etc/spark/conf/hive-site.xml"),
          owner=params.zeppelin_user, group=params.zeppelin_group)
 
     if len(params.hbase_master_hosts) > 0:
       # copy hbase-site.xml
-      hbase_site_xml_content = open("/etc/hbase/conf/hbase-site.xml").read()
-      File(format("{params.conf_dir}/hbase-site.xml"), content=hbase_site_xml_content,
+      File(format("{params.conf_dir}/hbase-site.xml"), content=StaticFile("/etc/hbase/conf/hbase-site.xml"),
            owner=params.zeppelin_user, group=params.zeppelin_group)
 
   def stop(self, env):
@@ -172,9 +173,7 @@ class Master(Script):
             + params.zeppelin_log_file, user=params.zeppelin_user)
     pidfile = glob.glob(os.path.join(status_params.zeppelin_pid_dir,
                                      'zeppelin-' + params.zeppelin_user + '*.pid'))[0]
-    Execute('echo pid file is: ' + pidfile, user=params.zeppelin_user)
-    contents = open(pidfile).read()
-    Execute('echo pid is ' + contents, user=params.zeppelin_user)
+    Logger.info(format("Pid file is: {pidfile}"))
 
   def status(self, env):
     import status_params
@@ -192,9 +191,8 @@ class Master(Script):
     import json
 
     interpreter_config = os.path.join(params.conf_dir, "interpreter.json")
-    interpreter_config_file = open(interpreter_config, "r")
-    config_data = json.load(interpreter_config_file)
-    interpreter_config_file.close()
+    config_content = sudo.read_file(interpreter_config)
+    config_data = json.loads(config_content)
     return config_data
 
   def set_interpreter_settings(self, config_data):


[2/2] ambari git commit: AMBARI-17973. Zeppelin start fails in non-root (aonishuk)

Posted by ao...@apache.org.
AMBARI-17973. Zeppelin start fails in non-root (aonishuk)


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

Branch: refs/heads/branch-2.4
Commit: 4b0a61ae2dd5f2bd52480fa16bebc094656c447e
Parents: d0a5ab0
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Mon Aug 1 14:55:12 2016 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Mon Aug 1 14:55:12 2016 +0300

----------------------------------------------------------------------
 .../ZEPPELIN/0.6.0.2.5/package/scripts/master.py  | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4b0a61ae/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
index 531e613..4202c0c 100644
--- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
+++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
@@ -23,6 +23,9 @@ import os
 from resource_management.core.resources import Directory
 from resource_management.core.resources.system import Execute, File
 from resource_management.core.source import InlineTemplate
+from resource_management.core import sudo
+from resource_management.core.logger import Logger
+from resource_management.core.source import StaticFile
 from resource_management.libraries import XmlConfig
 from resource_management.libraries.functions.check_process_status import check_process_status
 from resource_management.libraries.functions.format import format
@@ -127,14 +130,12 @@ class Master(Script):
          owner=params.zeppelin_user, group=params.zeppelin_group)
 
     # copy hive-site.xml
-    hive_site_xml_content = open("/etc/spark/conf/hive-site.xml").read()
-    File(format("{params.conf_dir}/hive-site.xml"), content=hive_site_xml_content,
+    File(format("{params.conf_dir}/hive-site.xml"), content=StaticFile("/etc/spark/conf/hive-site.xml"),
          owner=params.zeppelin_user, group=params.zeppelin_group)
 
     if len(params.hbase_master_hosts) > 0:
       # copy hbase-site.xml
-      hbase_site_xml_content = open("/etc/hbase/conf/hbase-site.xml").read()
-      File(format("{params.conf_dir}/hbase-site.xml"), content=hbase_site_xml_content,
+      File(format("{params.conf_dir}/hbase-site.xml"), content=StaticFile("/etc/hbase/conf/hbase-site.xml"),
            owner=params.zeppelin_user, group=params.zeppelin_group)
 
   def stop(self, env):
@@ -172,9 +173,7 @@ class Master(Script):
             + params.zeppelin_log_file, user=params.zeppelin_user)
     pidfile = glob.glob(os.path.join(status_params.zeppelin_pid_dir,
                                      'zeppelin-' + params.zeppelin_user + '*.pid'))[0]
-    Execute('echo pid file is: ' + pidfile, user=params.zeppelin_user)
-    contents = open(pidfile).read()
-    Execute('echo pid is ' + contents, user=params.zeppelin_user)
+    Logger.info(format("Pid file is: {pidfile}"))
 
   def status(self, env):
     import status_params
@@ -192,9 +191,8 @@ class Master(Script):
     import json
 
     interpreter_config = os.path.join(params.conf_dir, "interpreter.json")
-    interpreter_config_file = open(interpreter_config, "r")
-    config_data = json.load(interpreter_config_file)
-    interpreter_config_file.close()
+    config_content = sudo.read_file(interpreter_config)
+    config_data = json.loads(config_content)
     return config_data
 
   def set_interpreter_settings(self, config_data):