This is an automated email from the ASF dual-hosted git repository. adoroszlai pushed a commit to branch branch-2.6 in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/branch-2.6 by this push: new b87b895 AMBARI-23380. Fix intermittent "No such file or directory" error in TestHostCleanup (#1207) b87b895 is described below commit b87b895fb351ef0c08d0e70d78191fd3d868edbe Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com> AuthorDate: Tue May 8 19:12:34 2018 +0200 AMBARI-23380. Fix intermittent "No such file or directory" error in TestHostCleanup (#1207) --- ambari-agent/src/main/python/ambari_agent/HostCleanup.py | 2 +- ambari-agent/src/test/python/ambari_agent/TestHostCleanup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ambari-agent/src/main/python/ambari_agent/HostCleanup.py b/ambari-agent/src/main/python/ambari_agent/HostCleanup.py index 3187a7f..289452c 100644 --- a/ambari-agent/src/main/python/ambari_agent/HostCleanup.py +++ b/ambari-agent/src/main/python/ambari_agent/HostCleanup.py @@ -425,7 +425,7 @@ class HostCleanup: for folder in folders: for filename in os.listdir(folder): fileToCheck = os.path.join(folder, filename) - stat = os.stat(fileToCheck) + stat = os.lstat(fileToCheck) if stat.st_uid in userIds: self.do_erase_dir_silent([fileToCheck]) logger.info("Deleting file/folder: " + fileToCheck) diff --git a/ambari-agent/src/test/python/ambari_agent/TestHostCleanup.py b/ambari-agent/src/test/python/ambari_agent/TestHostCleanup.py index 165c5f0..441a75e 100644 --- a/ambari-agent/src/test/python/ambari_agent/TestHostCleanup.py +++ b/ambari-agent/src/test/python/ambari_agent/TestHostCleanup.py @@ -331,7 +331,7 @@ class TestHostCleanup(TestCase): sys.stdout = sys.__stdout__ @patch.object(HostCleanup.HostCleanup, 'do_erase_dir_silent') - @patch("os.stat") + @patch("os.lstat") @patch("os.path.join") @patch("os.listdir") def test_do_delete_by_owner(self, listdir_mock, join_mock, stat_mock, do_erase_dir_silent_method): -- To stop receiving notification emails like this one, please contact adorosz...@apache.org.