AMBARI-21446. Force-remove package does not work on CentOS 6 and SuSE 11
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4bbdd0e5 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4bbdd0e5 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4bbdd0e5 Branch: refs/heads/branch-feature-AMBARI-21348 Commit: 4bbdd0e550ed96aca5f7fcbd2036cf72543a10b3 Parents: 621f380 Author: Attila Doroszlai <adorosz...@hortonworks.com> Authored: Wed Jul 12 11:13:46 2017 +0200 Committer: Siddharth Wagle <swa...@hortonworks.com> Committed: Wed Jul 12 11:21:11 2017 -0700 ---------------------------------------------------------------------- .../src/test/python/resource_management/TestPackageResource.py | 4 ++-- .../python/resource_management/core/providers/package/yumrpm.py | 2 +- .../python/resource_management/core/providers/package/zypper.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/4bbdd0e5/ambari-agent/src/test/python/resource_management/TestPackageResource.py ---------------------------------------------------------------------- diff --git a/ambari-agent/src/test/python/resource_management/TestPackageResource.py b/ambari-agent/src/test/python/resource_management/TestPackageResource.py index bc1bfeb..51a35eb 100644 --- a/ambari-agent/src/test/python/resource_management/TestPackageResource.py +++ b/ambari-agent/src/test/python/resource_management/TestPackageResource.py @@ -228,7 +228,7 @@ class TestPackageResource(TestCase): logoutput = False, ignore_dependencies = True ) - shell_mock.assert_called_with(['/usr/bin/rpm', '-e', '--nodeps', 'some_package'], logoutput=False, sudo=True) + shell_mock.assert_called_with(['rpm', '-e', '--nodeps', 'some_package'], logoutput=False, sudo=True) @patch.object(shell, "call", new = MagicMock(return_value=(0, None))) @patch.object(shell, "checked_call") @@ -256,7 +256,7 @@ class TestPackageResource(TestCase): logoutput = False, ignore_dependencies = True ) - shell_mock.assert_called_with(['/usr/bin/rpm', '-e', '--nodeps', 'some_package'], logoutput=False, sudo=True) + shell_mock.assert_called_with(['rpm', '-e', '--nodeps', 'some_package'], logoutput=False, sudo=True) @patch.object(shell, "call", new = MagicMock(return_value=(0, None))) @patch.object(shell, "checked_call") http://git-wip-us.apache.org/repos/asf/ambari/blob/4bbdd0e5/ambari-common/src/main/python/resource_management/core/providers/package/yumrpm.py ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/python/resource_management/core/providers/package/yumrpm.py b/ambari-common/src/main/python/resource_management/core/providers/package/yumrpm.py index 064b504..a2f0533 100644 --- a/ambari-common/src/main/python/resource_management/core/providers/package/yumrpm.py +++ b/ambari-common/src/main/python/resource_management/core/providers/package/yumrpm.py @@ -36,7 +36,7 @@ REMOVE_CMD = { False: ['/usr/bin/yum', '-d', '0', '-e', '0', '-y', 'erase'], } -REMOVE_WITHOUT_DEPENDENCIES_CMD = ['/usr/bin/rpm', '-e', '--nodeps'] +REMOVE_WITHOUT_DEPENDENCIES_CMD = ['rpm', '-e', '--nodeps'] REPO_UPDATE_CMD = ['/usr/bin/yum', 'clean','metadata'] http://git-wip-us.apache.org/repos/asf/ambari/blob/4bbdd0e5/ambari-common/src/main/python/resource_management/core/providers/package/zypper.py ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/python/resource_management/core/providers/package/zypper.py b/ambari-common/src/main/python/resource_management/core/providers/package/zypper.py index c1aab60..f3abdb5 100644 --- a/ambari-common/src/main/python/resource_management/core/providers/package/zypper.py +++ b/ambari-common/src/main/python/resource_management/core/providers/package/zypper.py @@ -35,7 +35,7 @@ REMOVE_CMD = { False: ['/usr/bin/zypper', '--quiet', 'remove', '--no-confirm'], } -REMOVE_WITHOUT_DEPENDENCIES_CMD = ['/usr/bin/rpm', '-e', '--nodeps'] +REMOVE_WITHOUT_DEPENDENCIES_CMD = ['rpm', '-e', '--nodeps'] REPO_UPDATE_CMD = ['/usr/bin/zypper', 'clean']