You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ab...@apache.org on 2014/12/11 12:28:47 UTC

ambari git commit: AMBARI-8649 - Cluster deployment failed on Win

Repository: ambari
Updated Branches:
  refs/heads/trunk 59fa68e77 -> 5b0e8bd9c


AMBARI-8649 - Cluster deployment failed on Win


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

Branch: refs/heads/trunk
Commit: 5b0e8bd9cf04432d8bfcccbbf838491b18e36fc4
Parents: 59fa68e
Author: Artem Baranchuk <ab...@hortonworks.com>
Authored: Tue Dec 9 23:04:58 2014 +0200
Committer: Artem Baranchuk <ab...@hortonworks.com>
Committed: Thu Dec 11 13:28:22 2014 +0200

----------------------------------------------------------------------
 ambari-agent/src/main/python/ambari_agent/HostInfo.py    |  8 +++++---
 .../src/main/python/ambari_agent/PythonExecutor.py       | 11 ++++++++++-
 .../controller/internal/AbstractResourceProvider.java    |  2 +-
 .../src/main/resources/Ambari-DDL-SQLServer-CREATE.sql   |  7 ++++++-
 .../src/main/resources/Ambari-DDL-SQLServer-DROP.sql     |  2 ++
 ambari-web/app/controllers/wizard/step8_controller.js    |  2 +-
 6 files changed, 25 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/5b0e8bd9/ambari-agent/src/main/python/ambari_agent/HostInfo.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/HostInfo.py b/ambari-agent/src/main/python/ambari_agent/HostInfo.py
index 0b80ffe..a99a85d 100644
--- a/ambari-agent/src/main/python/ambari_agent/HostInfo.py
+++ b/ambari-agent/src/main/python/ambari_agent/HostInfo.py
@@ -47,6 +47,8 @@ class HostInfo(object):
     "hadoop", "zookeeper"
   ]
 
+  RESULT_UNAVAILABLE = "unable_to_determine"
+
   current_umask = -1
 
   def __init__(self, config=None):
@@ -167,8 +169,6 @@ class HostInfoLinux(HostInfo):
     "ambari", "HDP-UTILS"
   ]
 
-  RESULT_UNAVAILABLE = "unable_to_determine"
-
   DEFAULT_SERVICE_NAME = "ntpd"
   SERVICE_STATUS_CMD = "%s %s status" % (SERVICE_CMD, DEFAULT_SERVICE_NAME)
 
@@ -412,6 +412,8 @@ class HostInfoWindows(HostInfo):
   DEFAULT_LIVE_SERVICES = [
     {OSConst.WINSRV_FAMILY: "W32Time"}
   ]
+  DEFAULT_USERS = ["hadoop"]
+
   def checkUsers(self, users, results):
     get_users_cmd = ["powershell", '-noProfile', '-NonInteractive', '-nologo', "-Command", self.GET_USERS_CMD]
     try:
@@ -521,4 +523,4 @@ def main(argv=None):
 
 
 if __name__ == '__main__':
-  main()
+  main()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/5b0e8bd9/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py b/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py
index 15698a5..2ba492f 100644
--- a/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py
+++ b/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py
@@ -142,9 +142,18 @@ class PythonExecutor:
     to make possible unit testing
     """
     close_fds = None if OSCheck.get_os_family() == OSConst.WINSRV_FAMILY else True
+
+    if OSCheck.get_os_family() == OSConst.WINSRV_FAMILY:
+      command_env = dict(os.environ)
+      command_env["PYTHONPATH"] = os.pathsep.join(sys.path)
+      for k, v in command_env.iteritems():
+        command_env[k] = str(v)
+    else:
+      command_env = None
+
     return subprocess.Popen(command,
       stdout=tmpout,
-      stderr=tmperr, close_fds=close_fds)
+      stderr=tmperr, close_fds=close_fds, env=command_env)
 
   def isSuccessfull(self, returncode):
     return not self.python_process_has_been_killed and returncode == 0

http://git-wip-us.apache.org/repos/asf/ambari/blob/5b0e8bd9/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractResourceProvider.java
index 69d13b5..652cae3 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractResourceProvider.java
@@ -366,7 +366,7 @@ public abstract class AbstractResourceProvider extends BaseProvider implements R
             PropertyHelper.getPropertyName(desiredConfigKey + '/' + e.getKey());
           String absCatategory =
             PropertyHelper.getPropertyCategory(desiredConfigKey + '/' + e.getKey());
-          parseProperties(newConfig, absCatategory, propName, e.getValue().toString());
+          parseProperties(newConfig, absCatategory, propName, e.getValue() == null ? null : e.getValue().toString());
         }
         configs.add(newConfig);
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/5b0e8bd9/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
index bf4bf80..c044ff6 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
@@ -85,6 +85,7 @@ CREATE TABLE adminprincipal (principal_id BIGINT NOT NULL, principal_type_id INT
 CREATE TABLE adminpermission (permission_id BIGINT NOT NULL, permission_name VARCHAR(255) NOT NULL, resource_type_id INTEGER NOT NULL, PRIMARY KEY(permission_id));
 CREATE TABLE adminprivilege (privilege_id BIGINT, permission_id BIGINT NOT NULL, resource_id BIGINT NOT NULL, principal_id BIGINT NOT NULL, PRIMARY KEY(privilege_id));
 CREATE TABLE host_version (id BIGINT NOT NULL, host_name VARCHAR(255) NOT NULL, stack VARCHAR(255) NOT NULL, version VARCHAR(255) NOT NULL, state VARCHAR(32) NOT NULL, PRIMARY KEY (id));
+CREATE TABLE repo_version (repo_version_id BIGINT NOT NULL, stack VARCHAR(255) NOT NULL, version VARCHAR(255) NOT NULL, display_name VARCHAR(128) NOT NULL, upgrade_package VARCHAR(255) NOT NULL, repositories VARCHAR(MAX) NOT NULL, PRIMARY KEY(repo_version_id));
 
 -- altering tables by creating unique constraints----------
 --------altering tables to add constraints----------
@@ -97,6 +98,8 @@ ALTER TABLE viewinstance ADD CONSTRAINT UQ_viewinstance_name UNIQUE (view_name,
 ALTER TABLE viewinstance ADD CONSTRAINT UQ_viewinstance_name_id UNIQUE (view_instance_id, view_name, name);
 ALTER TABLE serviceconfig ADD CONSTRAINT UQ_scv_service_version UNIQUE (cluster_id, service_name, version);
 ALTER TABLE adminpermission ADD CONSTRAINT UQ_perm_name_resource_type_id UNIQUE (permission_name, resource_type_id);
+ALTER TABLE repo_version ADD CONSTRAINT UQ_repo_version_display_name UNIQUE (display_name);
+ALTER TABLE repo_version ADD CONSTRAINT UQ_repo_version_stack_version UNIQUE (stack, version);
 
 -- altering tables by creating foreign keys----------
 ALTER TABLE members ADD CONSTRAINT FK_members_group_id FOREIGN KEY (group_id) REFERENCES groups (group_id);
@@ -360,7 +363,9 @@ BEGIN TRANSACTION
   UNION ALL
   SELECT 'upgrade_item_id_seq', 0
   UNION ALL
-  SELECT 'host_version_id_seq', 0;
+  SELECT 'host_version_id_seq', 0
+  UNION ALL
+  SELECT 'repo_version_id_seq', 0;
 
   insert into adminresourcetype (resource_type_id, resource_type_name)
     select 1, 'AMBARI'

http://git-wip-us.apache.org/repos/asf/ambari/blob/5b0e8bd9/ambari-server/src/main/resources/Ambari-DDL-SQLServer-DROP.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-SQLServer-DROP.sql b/ambari-server/src/main/resources/Ambari-DDL-SQLServer-DROP.sql
index 63b88ee..ea31c4c 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-SQLServer-DROP.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-SQLServer-DROP.sql
@@ -205,3 +205,5 @@ IF OBJECT_ID('adminprincipal', 'U') IS NOT NULL DROP TABLE adminprincipal
 GO
 IF OBJECT_ID('adminprincipaltype', 'U') IS NOT NULL DROP TABLE adminprincipaltype
 GO
+IF OBJECT_ID('repo_version', 'U') IS NOT NULL DROP TABLE repo_version
+GO
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/5b0e8bd9/ambari-web/app/controllers/wizard/step8_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js
index 5d02440..db0b894 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -1721,7 +1721,7 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wiz
 
     coreSiteObj.forEach(function (_coreSiteObj) {
       //proxyuser_group property should be added only if proxyuser properties are used
-      if (_coreSiteObj.name === proxyuserGroup.name) return;
+      if (proxyuserGroup && _coreSiteObj.name === proxyuserGroup.name) return;
 
       // exclude some configs if service wasn't selected
       var addProperty = optionalCoreSiteConfigs.every(function (config) {