AMBARI-9962. HostCleanup.py does not remove packages (dlysnichenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/844687f0 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/844687f0 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/844687f0 Branch: refs/heads/trunk Commit: 844687f0c81104403226c55af356edcf43532aa5 Parents: 8775d88 Author: Lisnichenko Dmitro <dlysniche...@hortonworks.com> Authored: Fri Mar 6 20:54:21 2015 +0200 Committer: Lisnichenko Dmitro <dlysniche...@hortonworks.com> Committed: Fri Mar 6 20:55:39 2015 +0200 ---------------------------------------------------------------------- ambari-agent/src/main/python/ambari_agent/HostCleanup.py | 2 +- .../src/test/python/resource_management/TestUserResource.py | 2 +- ambari-common/src/main/python/ambari_commons/constants.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/844687f0/ambari-agent/src/main/python/ambari_agent/HostCleanup.py ---------------------------------------------------------------------- diff --git a/ambari-agent/src/main/python/ambari_agent/HostCleanup.py b/ambari-agent/src/main/python/ambari_agent/HostCleanup.py index 3e7e83f..ca9bc41 100644 --- a/ambari-agent/src/main/python/ambari_agent/HostCleanup.py +++ b/ambari-agent/src/main/python/ambari_agent/HostCleanup.py @@ -477,7 +477,7 @@ class HostCleanup: # Run command as sudoer by default, if root no issues def run_os_command(self, cmd, runWithSudo=True): if runWithSudo: - cmd = AMBARI_SUDO_BINARY + cmd + cmd = "/var/lib/ambari-agent/"+AMBARI_SUDO_BINARY + " " + cmd logger.info('Executing command: ' + str(cmd)) if type(cmd) == str: cmd = shlex.split(cmd) http://git-wip-us.apache.org/repos/asf/ambari/blob/844687f0/ambari-agent/src/test/python/resource_management/TestUserResource.py ---------------------------------------------------------------------- diff --git a/ambari-agent/src/test/python/resource_management/TestUserResource.py b/ambari-agent/src/test/python/resource_management/TestUserResource.py index c757361..3062881 100644 --- a/ambari-agent/src/test/python/resource_management/TestUserResource.py +++ b/ambari-agent/src/test/python/resource_management/TestUserResource.py @@ -183,7 +183,7 @@ class TestUserResource(TestCase): user = User("mapred", action = "create", groups = ['1','2','3'], shell = "/bin/bash") - popen_mock.assert_called_with(['/bin/bash', '--login', '--noprofile', '-c', "ambari-sudo.sh PATH=/bin -H -E usermod -G 1,2,3 -s /bin/bash mapred"], shell=False, preexec_fn=None, stderr=-2, stdout=5, bufsize=1, env={'PATH': '/bin'}, cwd=None) + popen_mock.assert_called_with(['/bin/bash', '--login', '--noprofile', '-c', 'ambari-sudo.sh PATH=/bin -H -E usermod -G 1,2,3,hadoop -s /bin/bash mapred'], shell=False, preexec_fn=None, stderr=-2, stdout=5, env={'PATH': '/bin'}, bufsize=1, cwd=None) self.assertEqual(popen_mock.call_count, 1) @patch.object(subprocess, "Popen") http://git-wip-us.apache.org/repos/asf/ambari/blob/844687f0/ambari-common/src/main/python/ambari_commons/constants.py ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/python/ambari_commons/constants.py b/ambari-common/src/main/python/ambari_commons/constants.py index b823b31..99ff679 100644 --- a/ambari-common/src/main/python/ambari_commons/constants.py +++ b/ambari-common/src/main/python/ambari_commons/constants.py @@ -18,4 +18,4 @@ See the License for the specific language governing permissions and limitations under the License. ''' -AMBARI_SUDO_BINARY = "ambari-sudo.sh" \ No newline at end of file +AMBARI_SUDO_BINARY = "ambari-sudo.sh"