You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2016/12/14 18:07:42 UTC
[1/2] ambari git commit: AMBARI-19203. LLAP app package cleanup fails
after Hive Interactive start failure in non-root (aonishuk)
Repository: ambari
Updated Branches:
refs/heads/branch-2.5 10cb81af4 -> 0d2ceecd2
refs/heads/trunk cb8182e9a -> 7dcabf565
AMBARI-19203. LLAP app package cleanup fails after Hive Interactive start failure in non-root (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7dcabf56
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7dcabf56
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7dcabf56
Branch: refs/heads/trunk
Commit: 7dcabf5656963a2b81dae13fa03ac51638b1eb26
Parents: cb8182e
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Wed Dec 14 20:07:39 2016 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Wed Dec 14 20:07:39 2016 +0200
----------------------------------------------------------------------
.../package/scripts/hive_server_interactive.py | 25 ++++++++++----------
1 file changed, 12 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/7dcabf56/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
index e04c53c..8c48edc 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
@@ -31,7 +31,7 @@ from resource_management.libraries.script.script import Script
from resource_management.libraries.functions import format
from resource_management.libraries.functions.check_process_status import check_process_status
from resource_management.core.source import InlineTemplate
-from resource_management.core.resources.system import Execute
+from resource_management.core.resources.system import Execute, Directory
# Imports needed for Rolling/Express Upgrade
from resource_management.libraries.functions import StackFeature
@@ -344,12 +344,11 @@ class HiveServerInteractiveDefault(HiveServerInteractive):
except:
# Attempt to clean up the packaged application, or potentially rename it with a .bak
if run_file_path is not None and cleanup:
- try:
- parent_dir = os.path.dirname(run_file_path)
- if os.path.isdir(parent_dir):
- shutil.rmtree(parent_dir)
- except Exception, e:
- Logger.error("Could not cleanup LLAP app package. Error: " + str(e))
+ parent_dir = os.path.dirname(run_file_path)
+ Directory(parent_dir,
+ action = "delete",
+ ignore_failures = True,
+ )
# throw the original exception
raise
@@ -375,14 +374,14 @@ class HiveServerInteractiveDefault(HiveServerInteractive):
if file_names:
for path in file_names:
abs_path = Script.get_tmp_dir()+"/"+path
- if os.path.isdir(abs_path):
- shutil.rmtree(abs_path)
- Logger.info("Deleted previous run 'LLAP package' folder : {0}".format(abs_path))
+ Directory(abs_path,
+ action = "delete",
+ ignore_failures = True
+ )
else:
Logger.info("No '{0}*' folder deleted.".format(llap_package_folder_name_prefix))
- except Exception as e:
- Logger.info("Exception while doing cleanup for past 'LLAP package(s)'.")
- traceback.print_exc()
+ except:
+ Logger.exception("Exception while doing cleanup for past 'LLAP package(s)':")
[2/2] ambari git commit: AMBARI-19203. LLAP app package cleanup fails
after Hive Interactive start failure in non-root (aonishuk)
Posted by ao...@apache.org.
AMBARI-19203. LLAP app package cleanup fails after Hive Interactive start failure in non-root (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0d2ceecd
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0d2ceecd
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0d2ceecd
Branch: refs/heads/branch-2.5
Commit: 0d2ceecd2a3bceca26d783ad5db8b78472c83708
Parents: 10cb81a
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Wed Dec 14 20:07:42 2016 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Wed Dec 14 20:07:42 2016 +0200
----------------------------------------------------------------------
.../package/scripts/hive_server_interactive.py | 25 ++++++++++----------
1 file changed, 12 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/0d2ceecd/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
index 055c690..f2f0554 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
@@ -31,7 +31,7 @@ from resource_management.libraries.script.script import Script
from resource_management.libraries.functions import format
from resource_management.libraries.functions.check_process_status import check_process_status
from resource_management.core.source import InlineTemplate
-from resource_management.core.resources.system import Execute
+from resource_management.core.resources.system import Execute, Directory
# Imports needed for Rolling/Express Upgrade
from resource_management.libraries.functions import StackFeature
@@ -345,12 +345,11 @@ class HiveServerInteractiveDefault(HiveServerInteractive):
except:
# Attempt to clean up the packaged application, or potentially rename it with a .bak
if run_file_path is not None and cleanup:
- try:
- parent_dir = os.path.dirname(run_file_path)
- if os.path.isdir(parent_dir):
- shutil.rmtree(parent_dir)
- except Exception, e:
- Logger.error("Could not cleanup LLAP app package. Error: " + str(e))
+ parent_dir = os.path.dirname(run_file_path)
+ Directory(parent_dir,
+ action = "delete",
+ ignore_failures = True,
+ )
# throw the original exception
raise
@@ -376,14 +375,14 @@ class HiveServerInteractiveDefault(HiveServerInteractive):
if file_names:
for path in file_names:
abs_path = Script.get_tmp_dir()+"/"+path
- if os.path.isdir(abs_path):
- shutil.rmtree(abs_path)
- Logger.info("Deleted previous run 'LLAP package' folder : {0}".format(abs_path))
+ Directory(abs_path,
+ action = "delete",
+ ignore_failures = True
+ )
else:
Logger.info("No '{0}*' folder deleted.".format(llap_package_folder_name_prefix))
- except Exception as e:
- Logger.info("Exception while doing cleanup for past 'LLAP package(s)'.")
- traceback.print_exc()
+ except:
+ Logger.exception("Exception while doing cleanup for past 'LLAP package(s)':")