Repository: ambari
Updated Branches:
  refs/heads/branch-1.7.0 9b7b32d27 -> 576fb5bc2


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/576fb5bc
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/576fb5bc
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/576fb5bc

Branch: refs/heads/branch-1.7.0
Commit: 576fb5bc218a199e78572914e622e2803ab3835c
Parents: 9b7b32d
Author: Andrew Onishuk <[email protected]>
Authored: Fri Oct 31 20:36:04 2014 +0200
Committer: Andrew Onishuk <[email protected]>
Committed: Fri Oct 31 20:36:04 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/576fb5bc/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/576fb5bc/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