You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by dm...@apache.org on 2015/05/21 17:08:11 UTC

ambari git commit: AMBARI-11269. Installing Service After Upgrading Stacks Fails Due To Broken Symlink (dlysnichenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk 18e9d2d31 -> 3be87ee55


AMBARI-11269. Installing Service After Upgrading Stacks Fails Due To Broken Symlink (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 3be87ee559e67dca703e6077f0539f9408de52be
Parents: 18e9d2d
Author: Lisnichenko Dmitro <dl...@hortonworks.com>
Authored: Thu May 21 18:07:40 2015 +0300
Committer: Lisnichenko Dmitro <dl...@hortonworks.com>
Committed: Thu May 21 18:07:40 2015 +0300

----------------------------------------------------------------------
 ambari-agent/src/test/python/resource_management/TestScript.py  | 5 +++--
 .../main/python/resource_management/libraries/script/script.py  | 4 +---
 2 files changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/3be87ee5/ambari-agent/src/test/python/resource_management/TestScript.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/resource_management/TestScript.py b/ambari-agent/src/test/python/resource_management/TestScript.py
index 5f21c7a..5107e1e 100644
--- a/ambari-agent/src/test/python/resource_management/TestScript.py
+++ b/ambari-agent/src/test/python/resource_management/TestScript.py
@@ -44,9 +44,9 @@ class TestScript(TestCase):
     sys.stdout = out
 
 
-
+  @patch.object(Script, 'set_version')
   @patch("resource_management.core.providers.package.PackageProvider")
-  def test_install_packages(self, package_provider_mock):
+  def test_install_packages(self, package_provider_mock, set_version_mock):
     no_packages_config = {
       'hostLevelParams' : {
         'repo_info' : "[{\"baseUrl\":\"http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.0.6.0\",\"osType\":\"centos6\",\"repoId\":\"HDP-2.0._\",\"repoName\":\"HDP\",\"defaultBaseUrl\":\"http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.0.6.0\"}]"
@@ -90,6 +90,7 @@ class TestScript(TestCase):
       script.install_packages("env")
     resource_dump = pprint.pformat(env.resource_list)
     self.assertEqual(resource_dump, '[Package[\'hbase\'], Package[\'yet-another-package\']]')
+    self.assertTrue(set_version_mock.called)
 
   @patch("__builtin__.open")
   def test_structured_out(self, open_mock):

http://git-wip-us.apache.org/repos/asf/ambari/blob/3be87ee5/ambari-common/src/main/python/resource_management/libraries/script/script.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/script/script.py b/ambari-common/src/main/python/resource_management/libraries/script/script.py
index f9eda81..b35f109 100644
--- a/ambari-common/src/main/python/resource_management/libraries/script/script.py
+++ b/ambari-common/src/main/python/resource_management/libraries/script/script.py
@@ -212,8 +212,6 @@ class Script(object):
       with Environment(self.basedir, tmp_dir=Script.tmp_dir) as env:
         env.config.download_path = Script.tmp_dir
         method(env)
-        if command_name == "install":
-          self.set_version()
     finally:
       if self.should_expose_component_version(command_name):
         self.save_component_version_to_structured_out()
@@ -372,7 +370,7 @@ class Script(object):
                           config["hostLevelParams"]["agentCacheDir"], "hdp.msi", hadoop_user, self.get_password(hadoop_user),
                           str(config['hostLevelParams']['stack_version']))
       reload_windows_env()
-    pass
+    self.set_version()
 
   @staticmethod
   def fail_with_error(message):