You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ad...@apache.org on 2018/05/07 08:45:53 UTC

[ambari] branch trunk updated: AMBARI-23741. Cannot install mpack due to No Environment present (#1183)

This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new b207020  AMBARI-23741. Cannot install mpack due to No Environment present (#1183)
b207020 is described below

commit b207020be6c5a5bfb2e699606487f6c66b489579
Author: Doroszlai, Attila <64...@users.noreply.github.com>
AuthorDate: Mon May 7 10:45:49 2018 +0200

    AMBARI-23741. Cannot install mpack due to No Environment present (#1183)
---
 ambari-server/src/main/python/ambari_server/setupMpacks.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/ambari-server/src/main/python/ambari_server/setupMpacks.py b/ambari-server/src/main/python/ambari_server/setupMpacks.py
index a0dde5a..b8c0974 100755
--- a/ambari-server/src/main/python/ambari_server/setupMpacks.py
+++ b/ambari-server/src/main/python/ambari_server/setupMpacks.py
@@ -27,7 +27,7 @@ import logging
 from ambari_server.serverClassPath import ServerClassPath
 
 from ambari_commons.exceptions import FatalException
-from ambari_commons.inet_utils import download_file, download_file_anyway
+from ambari_commons.inet_utils import download_file_anyway
 from ambari_commons.logging_utils import print_info_msg, print_error_msg, print_warning_msg
 from ambari_commons.os_utils import copy_file, run_os_command, change_owner, set_file_permissions
 from ambari_server.serverConfiguration import get_ambari_properties, get_ambari_version, get_stack_location, \
@@ -39,6 +39,7 @@ from ambari_server.userInput import get_YN_input
 from ambari_server.dbConfiguration import ensure_jdbc_driver_is_installed, LINUX_DBMS_KEYS_LIST
 
 from resource_management.core import sudo
+from resource_management.core.environment import Environment
 from resource_management.libraries.functions.tar_archive import untar_archive, get_archive_root_dir
 from resource_management.libraries.functions.version import compare_versions
 
@@ -158,7 +159,8 @@ def expand_mpack(archive_path):
   if os.path.exists(tmp_root_dir):
     sudo.rmtree(tmp_root_dir)
 
-  untar_archive(archive_path, tmpdir)
+  with Environment():
+    untar_archive(archive_path, tmpdir)
 
   if not os.path.exists(tmp_root_dir):
     print_error_msg("Malformed management pack. Failed to expand management pack!")
@@ -431,7 +433,7 @@ def process_stack_definitions_artifact(artifact, artifact_source_dir, options):
 
 def create_dashboard_symlinks(src_service_dir, service_name, dashboard_location, options):
   """
-  If there is a dashboards directory under the src_service_dir, 
+  If there is a dashboards directory under the src_service_dir,
   create symlinks under the dashboard_location for the grafana_dashboards
   and the service-metrics
   :param src_service_dir: Location of the service directory in the management pack
@@ -495,7 +497,7 @@ def process_extension_definitions_artifact(artifact, artifact_source_dir, option
         if os.path.exists(src_services_dir):
           for file in sorted(os.listdir(src_services_dir)):
             src_service_dir = os.path.join(src_services_dir, file)
-            create_dashboard_symlinks(src_service_dir, file, dashboard_location, options) 
+            create_dashboard_symlinks(src_service_dir, file, dashboard_location, options)
 
 def process_service_definitions_artifact(artifact, artifact_source_dir, options):
   """

-- 
To stop receiving notification emails like this one, please contact
adoroszlai@apache.org.