Repository: ambari Updated Branches: refs/heads/trunk 2a09dfeeb -> c0bbddb2d
AMBARI-11018. Unable to register host with non root ssh user (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c0bbddb2 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c0bbddb2 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c0bbddb2 Branch: refs/heads/trunk Commit: c0bbddb2d63b9c0156429a270ea6475775251e98 Parents: 2a09dfe Author: Andrew Onishuk <[email protected]> Authored: Fri May 8 14:54:27 2015 +0300 Committer: Andrew Onishuk <[email protected]> Committed: Fri May 8 14:54:27 2015 +0300 ---------------------------------------------------------------------- ambari-server/src/main/python/bootstrap.py | 5 ++++- ambari-server/src/test/python/TestBootstrap.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/c0bbddb2/ambari-server/src/main/python/bootstrap.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/python/bootstrap.py b/ambari-server/src/main/python/bootstrap.py index b22a10d..0173159 100755 --- a/ambari-server/src/main/python/bootstrap.py +++ b/ambari-server/src/main/python/bootstrap.py @@ -48,6 +48,8 @@ MAX_PARALLEL_BOOTSTRAPS = 20 POLL_INTERVAL_SEC = 1 DEBUG = False DEFAULT_AGENT_TEMP_FOLDER = "/var/lib/ambari-agent/data/tmp" +DEFAULT_AGENT_DATA_FOLDER = "/var/lib/ambari-agent/data" +DEFAULT_AGENT_LIB_FOLDER = "/var/lib/ambari-agent" PYTHON_ENV="env PYTHONPATH=$PYTHONPATH:" + DEFAULT_AGENT_TEMP_FOLDER CREATE_REMOTING_DIR_SCRIPT_NAME = "Create-RemotingDir.ps1" SEND_REMOTING_FILE_SCRIPT_NAME = "Send-RemotingFile.ps1" @@ -603,7 +605,8 @@ class BootstrapDefault(Bootstrap): params = self.shared_state user = params.user - command = "sudo mkdir -p {0} ; sudo chown -R {1} {0}".format(self.TEMP_FOLDER,quote_bash_args(params.user)) + command = "sudo mkdir -p {0} ; sudo chown -R {1} {0} ; sudo chmod 755 {3} ; sudo chmod 755 {2} ; sudo chmod 755 {0}".format( + self.TEMP_FOLDER, quote_bash_args(params.user), DEFAULT_AGENT_DATA_FOLDER, DEFAULT_AGENT_LIB_FOLDER) ssh = SSH(params.user, params.sshkey_file, self.host, command, params.bootdir, self.host_log) http://git-wip-us.apache.org/repos/asf/ambari/blob/c0bbddb2/ambari-server/src/test/python/TestBootstrap.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/TestBootstrap.py b/ambari-server/src/test/python/TestBootstrap.py index 8066d13..9c0e78e 100644 --- a/ambari-server/src/test/python/TestBootstrap.py +++ b/ambari-server/src/test/python/TestBootstrap.py @@ -354,7 +354,10 @@ class TestBootstrap(TestCase): command = str(init_mock.call_args[0][3]) self.assertEqual(command, "sudo mkdir -p /var/lib/ambari-agent/data/tmp ; " - "sudo chown -R root /var/lib/ambari-agent/data/tmp") + "sudo chown -R root /var/lib/ambari-agent/data/tmp ; " + "sudo chmod 755 /var/lib/ambari-agent ; " + "sudo chmod 755 /var/lib/ambari-agent/data ; " + "sudo chmod 755 /var/lib/ambari-agent/data/tmp") @patch.object(BootstrapDefault, "getOsCheckScript") @patch.object(BootstrapDefault, "getOsCheckScriptRemoteLocation")
