AMBARI-20361 - Stack Upgrade tests fail during Hive Metastore restart due to 
missing hive-site.jceks file (jonathanhurley)


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

Branch: refs/heads/branch-dev-logsearch
Commit: 8b7c661e714fa221447e3461325811ca3f0821c0
Parents: 197cc2e
Author: Jonathan Hurley <[email protected]>
Authored: Wed Mar 8 11:00:44 2017 -0500
Committer: Jonathan Hurley <[email protected]>
Committed: Wed Mar 8 13:31:03 2017 -0500

----------------------------------------------------------------------
 .../src/main/python/resource_management/core/source.py          | 5 +++--
 ambari-server/src/test/python/stacks/utils/RMFTestCase.py       | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8b7c661e/ambari-common/src/main/python/resource_management/core/source.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/core/source.py 
b/ambari-common/src/main/python/resource_management/core/source.py
index cee6f57..e31f7d6 100644
--- a/ambari-common/src/main/python/resource_management/core/source.py
+++ b/ambari-common/src/main/python/resource_management/core/source.py
@@ -72,16 +72,17 @@ class StaticFile(Source):
       basedir = self.env.config.basedir
       path = os.path.join(basedir, "files", self.name)
       
-    if not os.path.isfile(path) and not os.path.islink(path):
+    if not sudo.path_isfile(path) and not sudo.path_lexists(path):
       raise Fail("{0} Source file {1} is not found".format(repr(self), path))
 
     return self.read_file(path)
 
+
   @OsFamilyFuncImpl(os_family=OsFamilyImpl.DEFAULT)
   def read_file(self, path):
-    from resource_management.core import sudo
     return sudo.read_file(path)
 
+
   @OsFamilyFuncImpl(os_family=OSConst.WINSRV_FAMILY)
   def read_file(self, path):
     with open(path, "rb") as fp:

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b7c661e/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/utils/RMFTestCase.py 
b/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
index a101577..badaaef 100644
--- a/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
+++ b/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
@@ -326,6 +326,7 @@ def StaticFile(name, **kwargs):
   with RMFTestCase.env:
     from resource_management.core.source import StaticFile
     from resource_management.core import sudo
+    sudo.path_isfile = lambda path: True
     sudo.read_file = lambda path: 'dummy_output'
     return StaticFile(name, **kwargs)
   

Reply via email to