Repository: ambari
Updated Branches:
  refs/heads/trunk b935b50b6 -> 79c147a5e


AMBARI-8073. HostCleanup.py issues with HDP-2.2 on SuSe and Ubuntu (aonishuk)


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

Branch: refs/heads/trunk
Commit: 79c147a5e27adccd64baf0516adc263f5ff58c40
Parents: b935b50
Author: Andrew Onishuk <aonis...@hortonworks.com>
Authored: Fri Oct 31 20:38:03 2014 +0200
Committer: Andrew Onishuk <aonis...@hortonworks.com>
Committed: Fri Oct 31 20:38:03 2014 +0200

----------------------------------------------------------------------
 .../src/test/python/resource_management/TestPackageResource.py     | 2 +-
 .../python/resource_management/core/providers/package/yumrpm.py    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/79c147a5/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 8a680dd..faa89d0 100644
--- a/ambari-agent/src/test/python/resource_management/TestPackageResource.py
+++ b/ambari-agent/src/test/python/resource_management/TestPackageResource.py
@@ -69,7 +69,7 @@ class TestPackageResource(TestCase):
     with Environment('/') as env:
       Package("some_package",
       )
-    call_mock.assert_called_with('rpm -qa some_package')
+    call_mock.assert_called_with('installed_pkgs=`rpm -qa some_package` ; [ ! 
-z "$installed_pkgs" ]')
     shell_mock.assert_called_with("/usr/bin/yum -d 0 -e 0 -y install 
some_package")
 
   @patch.object(shell, "call")

http://git-wip-us.apache.org/repos/asf/ambari/blob/79c147a5/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 c878dab..0b26e76 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
@@ -26,7 +26,7 @@ from resource_management.core.logger import Logger
 
 INSTALL_CMD = "/usr/bin/yum -d 0 -e 0 -y install %s"
 REMOVE_CMD = "/usr/bin/yum -d 0 -e 0 -y erase %s"
-CHECK_CMD = "rpm -qa %s"
+CHECK_CMD = "installed_pkgs=`rpm -qa %s` ; [ ! -z \"$installed_pkgs\" ]"
 
 class YumProvider(PackageProvider):
   def install_package(self, name):

Reply via email to