ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmitriu...@apache.org
Subject ambari git commit: AMBARI-11789. RU: Installation of new stack failed for all hosts on SLES 11.3 (dlysnichenko)
Date Mon, 08 Jun 2015 17:17:40 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 98297b499 -> 0699ee9e7


AMBARI-11789. RU: Installation of new stack failed for all hosts on SLES 11.3 (dlysnichenko)


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

Branch: refs/heads/branch-2.1
Commit: 0699ee9e746f494d70d36ea51873f596168b7ca1
Parents: 98297b4
Author: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Authored: Mon Jun 8 20:16:14 2015 +0300
Committer: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Committed: Mon Jun 8 20:17:27 2015 +0300

----------------------------------------------------------------------
 .../custom_actions/scripts/install_packages.py  |  6 +-
 .../custom_actions/TestInstallPackages.py       | 92 +++++++++++++++-----
 2 files changed, 74 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0699ee9e/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 bbcc101..f8b2308 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
@@ -65,9 +65,11 @@ class InstallPackages(Script):
 
     # Install/update repositories
     installed_repositories = []
+    current_repositories = ['base']
     # Some packages are installed from core repos
-    # rhui* is used for rhel, and base is for centos
-    current_repositories = ['rhui*','base']
+    if OSCheck.is_redhat_family():
+      # rhui* is used for rhel, and base is for centos
+      current_repositories.append('rhui*')
     current_repo_files = set(['base'])
     old_versions = self.hdp_versions()
     

http://git-wip-us.apache.org/repos/asf/ambari/blob/0699ee9e/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 3b3d0dc..ecac6d4 100644
--- a/ambari-server/src/test/python/custom_actions/TestInstallPackages.py
+++ b/ambari-server/src/test/python/custom_actions/TestInstallPackages.py
@@ -46,7 +46,7 @@ class TestInstallPackages(RMFTestCase):
   @patch("resource_management.libraries.functions.list_ambari_managed_repos.list_ambari_managed_repos")
   @patch("resource_management.libraries.functions.packages_analyzer.allInstalledPackages")
   @patch("resource_management.libraries.script.Script.put_structured_out")
-  def test_normal_flow(self, put_structured_out_mock, allInstalledPackages_mock, list_ambari_managed_repos_mock):
+  def test_normal_flow_rhel(self, put_structured_out_mock, allInstalledPackages_mock, list_ambari_managed_repos_mock):
     allInstalledPackages_mock.side_effect = TestInstallPackages._add_packages
     list_ambari_managed_repos_mock.return_value=[]
     self.executeScript("scripts/install_packages.py",
@@ -80,13 +80,61 @@ class TestInstallPackages(RMFTestCase):
                               mirror_list=None,
                               append_to_file=True,
     )
-    self.assertResourceCalled('Package', 'hadoop_2_2_*', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
-    self.assertResourceCalled('Package', 'snappy', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
-    self.assertResourceCalled('Package', 'snappy-devel', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
-    self.assertResourceCalled('Package', 'lzo', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
-    self.assertResourceCalled('Package', 'hadooplzo_2_2_*', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
-    self.assertResourceCalled('Package', 'hadoop_2_2_*-libhdfs', use_repos=['rhui*', 'base',
'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
-    self.assertResourceCalled('Package', 'ambari-log4j', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'hadoop_2_2_*', use_repos=['base', 'rhui*', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'snappy', use_repos=['base', 'rhui*', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'snappy-devel', use_repos=['base', 'rhui*', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'lzo', use_repos=['base', 'rhui*', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'hadooplzo_2_2_*', use_repos=['base', 'rhui*', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'hadoop_2_2_*-libhdfs', use_repos=['base', 'rhui*',
'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'ambari-log4j', use_repos=['base', 'rhui*', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
+    self.assertNoMoreResources()
+
+  @patch("ambari_commons.os_check.OSCheck.is_suse_family")
+  @patch("resource_management.libraries.functions.list_ambari_managed_repos.list_ambari_managed_repos")
+  @patch("resource_management.libraries.functions.packages_analyzer.allInstalledPackages")
+  @patch("resource_management.libraries.script.Script.put_structured_out")
+  def test_normal_flow_sles(self, put_structured_out_mock, allInstalledPackages_mock, list_ambari_managed_repos_mock,
is_suse_family_mock):
+    is_suse_family_mock = True
+    allInstalledPackages_mock.side_effect = TestInstallPackages._add_packages
+    list_ambari_managed_repos_mock.return_value=[]
+    self.executeScript("scripts/install_packages.py",
+                       classname="InstallPackages",
+                       command="actionexecute",
+                       config_file="install_packages_config.json",
+                       target=RMFTestCase.TARGET_CUSTOM_ACTIONS,
+                       os_type=('Suse', '11', 'SP1'),
+                       )
+    self.assertTrue(put_structured_out_mock.called)
+    self.assertEquals(put_structured_out_mock.call_args[0][0],
+                      {'package_installation_result': 'SUCCESS',
+                       'installed_repository_version': u'2.2.0.1-885',
+                       'stack_id': 'HDP-2.2',
+                       'ambari_repositories': []})
+    self.assertResourceCalled('Repository', 'HDP-UTILS-2.2.0.1-885',
+                              base_url=u'http://repo1/HDP/centos5/2.x/updates/2.2.0.0',
+                              action=['create'],
+                              components=[u'HDP-UTILS', 'main'],
+                              repo_template='repo_suse_rhel.j2',
+                              repo_file_name=u'HDP-2.2.0.1-885',
+                              mirror_list=None,
+                              append_to_file=False,
+                              )
+    self.assertResourceCalled('Repository', 'HDP-2.2.0.1-885',
+                              base_url=u'http://repo1/HDP/centos5/2.x/updates/2.2.0.0',
+                              action=['create'],
+                              components=[u'HDP', 'main'],
+                              repo_template='repo_suse_rhel.j2',
+                              repo_file_name=u'HDP-2.2.0.1-885',
+                              mirror_list=None,
+                              append_to_file=True,
+                              )
+    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'])
+    self.assertResourceCalled('Package', 'snappy', use_repos=['base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'snappy-devel', use_repos=['base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'lzo', use_repos=['base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'hadooplzo_2_2_0_1_885*', use_repos=['base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'hadoop_2_2_0_1_885*-libhdfs', use_repos=['base',
'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'ambari-log4j', use_repos=['base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
     self.assertNoMoreResources()
 
 
@@ -130,13 +178,13 @@ class TestInstallPackages(RMFTestCase):
                               mirror_list=None,
                               append_to_file=True,
     )
-    self.assertResourceCalled('Package', 'hadoop_2_2_*', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
-    self.assertResourceCalled('Package', 'snappy', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
-    self.assertResourceCalled('Package', 'snappy-devel', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
-    self.assertResourceCalled('Package', 'lzo', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
-    self.assertResourceCalled('Package', 'hadooplzo_2_2_*', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
-    self.assertResourceCalled('Package', 'hadoop_2_2_*-libhdfs', use_repos=['rhui*', 'base',
'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
-    self.assertResourceCalled('Package', 'ambari-log4j', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'hadoop_2_2_*', use_repos=['base', 'rhui*', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'snappy', use_repos=['base', 'rhui*', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'snappy-devel', use_repos=['base', 'rhui*', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'lzo', use_repos=['base', 'rhui*', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'hadooplzo_2_2_*', use_repos=['base', 'rhui*', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'hadoop_2_2_*-libhdfs', use_repos=['base', 'rhui*',
'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'ambari-log4j', use_repos=['base', 'rhui*', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
     self.assertNoMoreResources()
 
 
@@ -247,11 +295,11 @@ class TestInstallPackages(RMFTestCase):
                               mirror_list=None,
                               append_to_file=True,
                               )
-    self.assertResourceCalled('Package', 'hadoop_2_2_0_1_885*', use_repos=['rhui*', 'base',
'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
-    self.assertResourceCalled('Package', 'snappy', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
-    self.assertResourceCalled('Package', 'snappy-devel', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
-    self.assertResourceCalled('Package', 'lzo', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
-    self.assertResourceCalled('Package', 'hadooplzo_2_2_0_1_885*', use_repos=['rhui*', 'base',
'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
-    self.assertResourceCalled('Package', 'hadoop_2_2_0_1_885*-libhdfs', use_repos=['rhui*',
'base', 'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
-    self.assertResourceCalled('Package', 'ambari-log4j', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
+    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'])
+    self.assertResourceCalled('Package', 'snappy', use_repos=['base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'snappy-devel', use_repos=['base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'lzo', use_repos=['base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'hadooplzo_2_2_0_1_885*', use_repos=['base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'hadoop_2_2_0_1_885*-libhdfs', use_repos=['base',
'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'ambari-log4j', use_repos=['base', 'HDP-UTILS-2.2.0.1-885',
'HDP-2.2.0.1-885'])
     self.assertNoMoreResources()
\ No newline at end of file


Mime
View raw message