ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhuvnesh2...@apache.org
Subject ambari git commit: AMBARI-16386: HAWQ Password handling updated (bhuvnesh2703)
Date Fri, 13 May 2016 22:12:18 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 4cb895c6c -> 8af1a231e


AMBARI-16386: HAWQ Password handling updated (bhuvnesh2703)


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

Branch: refs/heads/trunk
Commit: 8af1a231e3c7f88f167a40ea2c8ee12eccb5495e
Parents: 4cb895c
Author: Bhuvnesh Chaudhary <bhuvnesh2703@gmail.com>
Authored: Fri May 13 15:12:57 2016 -0700
Committer: Bhuvnesh Chaudhary <bhuvnesh2703@gmail.com>
Committed: Fri May 13 15:12:57 2016 -0700

----------------------------------------------------------------------
 .../common-services/HAWQ/2.0.0/package/scripts/common.py       | 2 +-
 .../HAWQ/2.0.0/package/scripts/master_helper.py                | 4 ++--
 .../src/test/python/stacks/2.3/HAWQ/test_hawqmaster.py         | 6 +++---
 .../src/test/python/stacks/2.3/HAWQ/test_hawqsegment.py        | 3 ++-
 .../src/test/python/stacks/2.3/HAWQ/test_hawqstandby.py        | 3 ++-
 5 files changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8af1a231/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py
index 1bdc85a..8c43555 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py
@@ -51,7 +51,7 @@ def __create_hawq_user():
 
   User(hawq_constants.hawq_user,
        gid=hawq_constants.hawq_group,
-       password=crypt.crypt(params.hawq_password, "salt"),
+       password=crypt.crypt(params.hawq_password, "$1$salt$"),
        groups=[hawq_constants.hawq_group, params.user_group],
        ignore_failures=True)
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/8af1a231/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/master_helper.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/master_helper.py
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/master_helper.py
index 670a58b..b52b477 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/master_helper.py
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/master_helper.py
@@ -16,8 +16,8 @@ See the License for the specific language governing permissions and
 limitations under the License.
 """
 import os
-
 import sys
+import json
 from resource_management.core.source import InlineTemplate
 from resource_management.core.logger import Logger
 from resource_management.libraries.functions.format import format
@@ -50,7 +50,7 @@ def setup_passwordless_ssh():
   failed_hosts = []
   for host in params.hawq_all_hosts:
     try:
-      utils.exec_hawq_operation("ssh-exkeys", format('-h {hawq_host} -p {hawq_password!p}',
hawq_host=host, hawq_password=params.hawq_password))
+      utils.exec_hawq_operation("ssh-exkeys", format('-h {hawq_host} -p {hawq_password!p}',
hawq_host=host, hawq_password=json.dumps(params.hawq_password)))
     except:
       failed_hosts.append(host)
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/8af1a231/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqmaster.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqmaster.py b/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqmaster.py
index 2671202..5cf2d2f 100644
--- a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqmaster.py
+++ b/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqmaster.py
@@ -18,7 +18,7 @@ See the License for the specific language governing permissions and
 limitations under the License.
 '''
 
-import os, json
+import os, json, crypt
 import  resource_management.libraries.functions
 
 from mock.mock import MagicMock, call, patch
@@ -52,7 +52,7 @@ class TestHawqMaster(RMFTestCase):
         gid = self.GPADMIN,
         groups = ['gpadmin', u'hadoop'],
         ignore_failures = True,
-        password = 'saNIJ3hOyqasU'
+        password = crypt.crypt(self.config_dict['configurations']['hawq-env']['hawq_password'],
"$1$salt$")
         )
 
     self.assertResourceCalled('Group', self.POSTGRES,
@@ -423,4 +423,4 @@ class TestHawqMaster(RMFTestCase):
         logoutput = True
         )
 
-    self.assertNoMoreResources()
\ No newline at end of file
+    self.assertNoMoreResources()

http://git-wip-us.apache.org/repos/asf/ambari/blob/8af1a231/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqsegment.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqsegment.py b/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqsegment.py
index 7963b3d..fde5fd3 100644
--- a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqsegment.py
+++ b/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqsegment.py
@@ -18,6 +18,7 @@ See the License for the specific language governing permissions and
 limitations under the License.
 '''
 
+import os, json, crypt
 from mock.mock import MagicMock, call, patch
 from stacks.utils.RMFTestCase import *
 
@@ -37,7 +38,7 @@ class TestHawqSegment(RMFTestCase):
         gid = self.GPADMIN,
         groups = [self.GPADMIN, u'hadoop'],
         ignore_failures = True,
-        password = 'saNIJ3hOyqasU'
+        password = crypt.crypt(self.getConfig()['configurations']['hawq-env']['hawq_password'],
"$1$salt$")
         )
 
     self.assertResourceCalled('Group', self.POSTGRES,

http://git-wip-us.apache.org/repos/asf/ambari/blob/8af1a231/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqstandby.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqstandby.py b/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqstandby.py
index 605f49a..e247d28 100644
--- a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqstandby.py
+++ b/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqstandby.py
@@ -18,6 +18,7 @@ See the License for the specific language governing permissions and
 limitations under the License.
 '''
 
+import os, json, crypt
 from mock.mock import MagicMock, call, patch
 from stacks.utils.RMFTestCase import *
 
@@ -38,7 +39,7 @@ class TestHawqStandby(RMFTestCase):
         gid = self.GPADMIN,
         groups = [self.GPADMIN, u'hadoop'],
         ignore_failures = True,
-        password = 'saNIJ3hOyqasU'
+        password = crypt.crypt(self.getConfig()['configurations']['hawq-env']['hawq_password'],
"$1$salt$")
         )
 
     self.assertResourceCalled('Group', self.POSTGRES,


Mime
View raw message