You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2017/11/30 14:25:16 UTC
[22/50] [abbrv] ambari git commit: AMBARI-22529. PERF stack fixes
(aonishuk)
AMBARI-22529. PERF stack fixes (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/530f1d5e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/530f1d5e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/530f1d5e
Branch: refs/heads/branch-feature-AMBARI-21674
Commit: 530f1d5e34eb5eb5e3e509bd9934a590bed64ac9
Parents: b832f70
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Tue Nov 28 15:30:10 2017 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Tue Nov 28 15:30:10 2017 +0200
----------------------------------------------------------------------
.../main/java/org/apache/ambari/server/state/ServiceInfo.java | 2 +-
.../stacks/PERF/1.0/hooks/before-INSTALL/scripts/hook.py | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/530f1d5e/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
index f1c63bf..c0342eb 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
@@ -87,7 +87,7 @@ public class ServiceInfo implements Validable{
JAVA
}
@XmlElement(name="service_advisor_type")
- private ServiceAdvisorType serviceAdvisorType = null;
+ private ServiceAdvisorType serviceAdvisorType = ServiceAdvisorType.PYTHON;
@XmlTransient
private List<PropertyInfo> properties;
http://git-wip-us.apache.org/repos/asf/ambari/blob/530f1d5e/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-INSTALL/scripts/hook.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-INSTALL/scripts/hook.py b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-INSTALL/scripts/hook.py
index 833fdbc..513b994 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-INSTALL/scripts/hook.py
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-INSTALL/scripts/hook.py
@@ -23,6 +23,7 @@ from resource_management.core.resources.system import Directory, File, Execute
from resource_management.libraries.script import Hook
AMBARI_AGENT_CACHE_DIR = 'AMBARI_AGENT_CACHE_DIR'
+DEFAULT_AMBARI_AGENT_CACHE_DIR = '/var/lib/ambari-agent/cache/'
BEFORE_INSTALL_SCRIPTS = "hooks/before-INSTALL/scripts"
STACK = "PERF/1.0"
@@ -38,6 +39,12 @@ class BeforeInstallHook(Hook):
self.run_custom_hook('before-ANY')
print "Before Install Hook"
cache_dir = self.extrakt_var_from_pythonpath(AMBARI_AGENT_CACHE_DIR)
+
+ # this happens if PythonExecutor.py.sed hack was not done.
+ if not cache_dir:
+ print "WARN: Cache dir for the agent could not be detected. Using default cache dir"
+ cache_dir = DEFAULT_AMBARI_AGENT_CACHE_DIR
+
conf_select = os.path.join(cache_dir, CONF_SELECT_PY)
dist_select = os.path.join(cache_dir, DISTRO_SELECT_PY)
try: