Repository: ambari Updated Branches: refs/heads/branch-2.4 5fc37db51 -> 215ffc334
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/215ffc33 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/215ffc33 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/215ffc33 Branch: refs/heads/branch-2.4 Commit: 215ffc334fc6a43a2e8f3b29d7c45e3475cb4ecb Parents: 5fc37db Author: Bhuvnesh Chaudhary <[email protected]> Authored: Fri May 13 15:13:37 2016 -0700 Committer: Bhuvnesh Chaudhary <[email protected]> Committed: Fri May 13 15:13:37 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/215ffc33/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/215ffc33/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/215ffc33/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/215ffc33/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/215ffc33/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,
