ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alejan...@apache.org
Subject ambari git commit: AMBARI-14811. RU/EU 'Install packages' fail on centos and suse on non-root (Andrew Onischuk via alejandro)
Date Wed, 27 Jan 2016 19:47:47 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 17093e420 -> a3676028a


AMBARI-14811. RU/EU 'Install packages' fail on centos and suse on non-root (Andrew Onischuk
via alejandro)


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

Branch: refs/heads/branch-2.2
Commit: a3676028ae5ca3f5b44226bee1a91d5cf5154ab8
Parents: 17093e4
Author: Alejandro Fernandez <afernandez@hortonworks.com>
Authored: Wed Jan 27 11:47:31 2016 -0800
Committer: Alejandro Fernandez <afernandez@hortonworks.com>
Committed: Wed Jan 27 11:47:31 2016 -0800

----------------------------------------------------------------------
 .../custom_actions/scripts/install_packages.py  |  6 ++--
 .../custom_actions/TestInstallPackages.py       | 35 +++++++++++---------
 2 files changed, 23 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a3676028/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py b/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py
index f68e3b1..821df77 100644
--- a/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py
+++ b/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py
@@ -170,16 +170,16 @@ class InstallPackages(Script):
     package_manager_cmd = ""
 
     if OSCheck.is_redhat_family():
-      package_manager_cmd = "/usr/bin/yum -q clean metadata"
+      package_manager_cmd = ("/usr/bin/yum", "clean", "metadata")
 
     if OSCheck.is_suse_family():
-      package_manager_cmd = "/usr/bin/zypper -q -n clean"
+      package_manager_cmd = ("/usr/bin/zypper", "-q", "-n", "clean")
 
     if OSCheck.is_ubuntu_family():
       return
 
     Logger.debug("Clearing repo manager metadata")
-    Execute(package_manager_cmd, logoutput=False)
+    Execute(package_manager_cmd, logoutput=False, sudo=True)
 
   def _create_config_links_if_necessary(self, stack_id, stack_version):
     """

http://git-wip-us.apache.org/repos/asf/ambari/blob/a3676028/ambari-server/src/test/python/custom_actions/TestInstallPackages.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/custom_actions/TestInstallPackages.py b/ambari-server/src/test/python/custom_actions/TestInstallPackages.py
index 59aab44..423ae9e 100644
--- a/ambari-server/src/test/python/custom_actions/TestInstallPackages.py
+++ b/ambari-server/src/test/python/custom_actions/TestInstallPackages.py
@@ -104,9 +104,10 @@ class TestInstallPackages(RMFTestCase):
                               mirror_list=None,
                               append_to_file=True,
     )
-    self.assertResourceCalled('Execute', '/usr/bin/yum -q clean metadata',
-                              logoutput = False,
-                              )
+    self.assertResourceCalled('Execute', ('/usr/bin/yum', 'clean', 'metadata'),
+        logoutput = False,
+        sudo = True,
+    )
     self.assertResourceCalled('Package', 'fuse')
     self.assertResourceCalled('Package', 'fuse-libs')
     self.assertResourceCalled('Package', 'hadoop_2_2_*', use_repos=['HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'], skip_repos=['HDP-*'])
@@ -167,9 +168,10 @@ class TestInstallPackages(RMFTestCase):
                               mirror_list=None,
                               append_to_file=True,
                               )
-    self.assertResourceCalled('Execute', '/usr/bin/zypper -q -n clean',
-                              logoutput = False,
-                              )
+    self.assertResourceCalled('Execute', ('/usr/bin/zypper', '-q', '-n', 'clean'),
+        logoutput = False,
+        sudo = True,
+    )
     self.assertResourceCalled('Package', 'fuse')
     self.assertResourceCalled('Package', 'libfuse2')
     self.assertResourceCalled('Package', 'hadoop_2_2_0_1_885*', use_repos=['base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'], skip_repos=[])
@@ -233,9 +235,10 @@ class TestInstallPackages(RMFTestCase):
                               mirror_list=None,
                               append_to_file=True,
     )
-    self.assertResourceCalled('Execute', '/usr/bin/yum -q clean metadata',
-                              logoutput = False,
-                              )
+    self.assertResourceCalled('Execute', ('/usr/bin/yum', 'clean', 'metadata'),
+        logoutput = False,
+        sudo = True,
+    )
     self.assertResourceCalled('Package', 'fuse')
     self.assertResourceCalled('Package', 'fuse-libs')
     self.assertResourceCalled('Package', 'hadoop_2_2_*', use_repos=['HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'], skip_repos=['HDP-*'])
@@ -314,9 +317,10 @@ class TestInstallPackages(RMFTestCase):
                               mirror_list=None,
                               append_to_file=True,
                               )
-    self.assertResourceCalled('Execute', '/usr/bin/yum -q clean metadata',
-                              logoutput = False,
-                              )
+    self.assertResourceCalled('Execute', ('/usr/bin/yum', 'clean', 'metadata'),
+        logoutput = False,
+        sudo = True,
+    )
     self.assertNoMoreResources()
 
     TestInstallPackages._install_failed = False
@@ -373,9 +377,10 @@ class TestInstallPackages(RMFTestCase):
                               mirror_list=None,
                               append_to_file=True,
                               )
-    self.assertResourceCalled('Execute', '/usr/bin/zypper -q -n clean',
-                              logoutput = False,
-                              )
+    self.assertResourceCalled('Execute', ('/usr/bin/zypper', '-q', '-n', 'clean'),
+        logoutput = False,
+        sudo = True,
+    )
     self.assertResourceCalled('Package', 'fuse')
     self.assertResourceCalled('Package', 'libfuse2')
     self.assertResourceCalled('Package', 'hadoop_2_2_0_1_885*', use_repos=['base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'], skip_repos=[])


Mime
View raw message