ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abaranc...@apache.org
Subject [1/2] ambari git commit: AMBARI-8557 - Python EXE path seems to be hardcoded in ambari-env.cmd (Eugene Chekanskiy via abaranchuk)
Date Fri, 12 Dec 2014 13:17:07 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 42f8d67dd -> 69afc2a05


AMBARI-8557 - Python EXE path seems to be hardcoded in ambari-env.cmd (Eugene Chekanskiy via
abaranchuk)


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

Branch: refs/heads/trunk
Commit: dcbc0d956710aa9c7cee7418ff023bd01cc6aa2f
Parents: 42f8d67
Author: Artem Baranchuk <abaranchuk@hortonworks.com>
Authored: Fri Dec 12 15:15:28 2014 +0200
Committer: Artem Baranchuk <abaranchuk@hortonworks.com>
Committed: Fri Dec 12 15:15:28 2014 +0200

----------------------------------------------------------------------
 ambari-agent/conf/windows/ambari-env.cmd     | 4 +---
 ambari-agent/conf/windows/service_wrapper.py | 3 +++
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/dcbc0d95/ambari-agent/conf/windows/ambari-env.cmd
----------------------------------------------------------------------
diff --git a/ambari-agent/conf/windows/ambari-env.cmd b/ambari-agent/conf/windows/ambari-env.cmd
index 6e0c317..20c5cbc 100644
--- a/ambari-agent/conf/windows/ambari-env.cmd
+++ b/ambari-agent/conf/windows/ambari-env.cmd
@@ -15,8 +15,6 @@ REM See the License for the specific language governing permissions and
 REM limitations under the License.
 
 set SERVICE_NAME=Ambari Agent
-REM REM set AMBARI_AGENT_CONF_DIR=C:\work\test\agent
+REM set AMBARI_AGENT_CONF_DIR=C:\work\test\agent
 REM set AMBARI_AGENT_LOG_DIR=logs
 set AGENT_SERVICE_WRAPPER=sbin\service_wrapper.py
-REM python exe that will be used for command execution(must have access to pywin32 and agent
python code)
-set PYTHON_EXE=C:\Python27\python.exe

http://git-wip-us.apache.org/repos/asf/ambari/blob/dcbc0d95/ambari-agent/conf/windows/service_wrapper.py
----------------------------------------------------------------------
diff --git a/ambari-agent/conf/windows/service_wrapper.py b/ambari-agent/conf/windows/service_wrapper.py
index 7eabb56..40be1d0 100644
--- a/ambari-agent/conf/windows/service_wrapper.py
+++ b/ambari-agent/conf/windows/service_wrapper.py
@@ -28,6 +28,7 @@ from ambari_commons.ambari_service import AmbariService, ENV_PYTHON_PATH
 from ambari_commons.exceptions import *
 from ambari_commons.logging_utils import *
 from ambari_commons.os_windows import WinServiceController
+from ambari_commons.os_utils import find_in_path
 from ambari_agent.AmbariConfig import AmbariConfig
 from ambari_agent.HeartbeatHandlers import HeartbeatStopHandlers
 
@@ -55,6 +56,8 @@ def parse_options():
     os.environ["AMBARI_AGENT_LOG_DIR"] = os.path.join("\\", "var", "log", "ambari-agent")
   if not os.path.exists(os.environ["AMBARI_AGENT_LOG_DIR"]):
     os.makedirs(os.environ["AMBARI_AGENT_LOG_DIR"])
+  if not os.environ.has_key("PYTHON_EXE"):
+    os.environ["PYTHON_EXE"] = find_in_path("python.exe")
 
 
 class AmbariAgentService(AmbariService):


Mime
View raw message