You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2015/08/07 20:34:07 UTC

ambari git commit: AMBARI-12676 - Upgrades Fail When Calling conf-select On hadoop When hadoop Is Not Installed (jonathanhurley)

Repository: ambari
Updated Branches:
  refs/heads/trunk f0713c36a -> ba3a2caa5


AMBARI-12676 - Upgrades Fail When Calling conf-select On hadoop When hadoop Is Not Installed (jonathanhurley)


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

Branch: refs/heads/trunk
Commit: ba3a2caa53ad9bf426664041f32abfb2d8df959d
Parents: f0713c3
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Fri Aug 7 10:48:17 2015 -0400
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Fri Aug 7 14:34:01 2015 -0400

----------------------------------------------------------------------
 .../libraries/functions/conf_select.py              |  8 +++++---
 .../python/stacks/2.3/MAHOUT/test_mahout_client.py  | 16 ++++------------
 2 files changed, 9 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ba3a2caa/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py b/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py
index 9e6adae..a676f74 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py
@@ -269,9 +269,6 @@ def get_hadoop_conf_dir(force_latest_on_upgrade=False):
       stack_name = stack_info[0]
       stack_version = stack_info[1]
 
-      # ensure the new HDP stack is conf-selected
-      select(stack_name, "hadoop", stack_version)
-
       # determine if hdp-select has been run and if not, then use the current
       # hdp version until this component is upgraded
       if not force_latest_on_upgrade:
@@ -282,6 +279,11 @@ def get_hadoop_conf_dir(force_latest_on_upgrade=False):
       # only change the hadoop_conf_dir path, don't conf-select this older version
       hadoop_conf_dir = "/usr/hdp/{0}/hadoop/conf".format(stack_version)
 
+      # ensure the new HDP stack is conf-selected, but only if it exists
+      # there are cases where hadoop might not be installed, such as on a host with only ZK
+      if os.path.exists(hadoop_conf_dir):
+        select(stack_name, "hadoop", stack_version)
+
   return hadoop_conf_dir
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba3a2caa/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_client.py b/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_client.py
index 4733867..1b79105 100644
--- a/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_client.py
+++ b/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_client.py
@@ -104,21 +104,13 @@ class TestMahoutClient(RMFTestCase):
     self.assertEquals("/usr/hdp/2.3.0.0-1234/hadoop/conf",
       sys.modules["params"].hadoop_conf_dir)
 
-    self.assertEquals(3, mocks_dict['call'].call_count)
-    self.assertEquals(3, mocks_dict['checked_call'].call_count)
-
-    self.assertEquals(
-      ('conf-select', 'set-conf-dir', '--package', 'hadoop', '--stack-version', '2.3.0.0-1234', '--conf-version', '0'),
-      mocks_dict['checked_call'].call_args_list[0][0][0])
-
-    self.assertEquals(
-      ('conf-select', 'create-conf-dir', '--package', 'hadoop', '--stack-version', '2.3.0.0-1234', '--conf-version', '0'),
-      mocks_dict['call'].call_args_list[0][0][0])
+    self.assertEquals(1, mocks_dict['call'].call_count)
+    self.assertEquals(1, mocks_dict['checked_call'].call_count)
 
     self.assertEquals(
       ('conf-select', 'set-conf-dir', '--package', 'mahout', '--stack-version', '2.3.0.0-1234', '--conf-version', '0'),
-      mocks_dict['checked_call'].call_args_list[1][0][0])
+      mocks_dict['checked_call'].call_args_list[0][0][0])
 
     self.assertEquals(
       ('conf-select', 'create-conf-dir', '--package', 'mahout', '--stack-version', '2.3.0.0-1234', '--conf-version', '0'),
-      mocks_dict['call'].call_args_list[1][0][0])
+      mocks_dict['call'].call_args_list[0][0][0])