ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fba...@apache.org
Subject ambari git commit: AMBARI-11206 [WinTP2] Ambari Agent fails to start
Date Mon, 18 May 2015 13:29:52 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 736696ba1 -> b950812eb


AMBARI-11206 [WinTP2] Ambari Agent fails to start

Moved the module imports inside functions, to immunize the startup against unused modules.


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

Branch: refs/heads/trunk
Commit: b950812eb89cd0571aea16a12dc9dee8653fb883
Parents: 736696b
Author: Florian Barca <fbarca@hortonworks.com>
Authored: Mon May 18 06:27:42 2015 -0700
Committer: Florian Barca <fbarca@hortonworks.com>
Committed: Mon May 18 06:29:23 2015 -0700

----------------------------------------------------------------------
 .../src/main/python/resource_management/core/utils.py          | 6 ++++--
 .../libraries/functions/check_process_status.py                | 3 ++-
 .../libraries/providers/modify_properties_file.py              | 2 +-
 3 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b950812e/ambari-common/src/main/python/resource_management/core/utils.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/core/utils.py b/ambari-common/src/main/python/resource_management/core/utils.py
index f9ad193..cc8b404 100644
--- a/ambari-common/src/main/python/resource_management/core/utils.py
+++ b/ambari-common/src/main/python/resource_management/core/utils.py
@@ -20,8 +20,6 @@ Ambari Agent
 
 """
 
-import grp
-import pwd
 from resource_management.core.exceptions import Fail
 
 class AttributeDictionary(object):
@@ -110,6 +108,8 @@ def checked_unite(dict1, dict2):
   return result
 
 def _coerce_uid(user):
+  import pwd
+
   try:
     uid = int(user)
   except ValueError:
@@ -121,6 +121,8 @@ def _coerce_uid(user):
 
 
 def _coerce_gid(group):
+  import grp
+
   try:
     gid = int(group)
   except ValueError:

http://git-wip-us.apache.org/repos/asf/ambari/blob/b950812e/ambari-common/src/main/python/resource_management/libraries/functions/check_process_status.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/check_process_status.py
b/ambari-common/src/main/python/resource_management/libraries/functions/check_process_status.py
index a3efabd..a3e4a39 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/check_process_status.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/check_process_status.py
@@ -23,7 +23,6 @@ Ambari Agent
 from resource_management.core.exceptions import ComponentIsNotRunning
 from resource_management.core.logger import Logger
 from resource_management.core import shell
-from resource_management.core import sudo
 __all__ = ["check_process_status"]
 
 import os
@@ -37,6 +36,8 @@ def check_process_status(pid_file):
 
   @param pid_file: path to service pid file
   """
+  from resource_management.core import sudo
+
   if not pid_file or not os.path.isfile(pid_file):
     raise ComponentIsNotRunning()
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/b950812e/ambari-common/src/main/python/resource_management/libraries/providers/modify_properties_file.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/providers/modify_properties_file.py
b/ambari-common/src/main/python/resource_management/libraries/providers/modify_properties_file.py
index a07881b..e71abb8 100644
--- a/ambari-common/src/main/python/resource_management/libraries/providers/modify_properties_file.py
+++ b/ambari-common/src/main/python/resource_management/libraries/providers/modify_properties_file.py
@@ -26,7 +26,7 @@ from resource_management.libraries.functions.format import format
 from resource_management.core.environment import Environment
 from resource_management.core.source import InlineTemplate
 from resource_management.core.logger import Logger
-from resource_management import sudo
+from resource_management.core import sudo
 
 
 class ModifyPropertiesFileProvider(Provider):


Mime
View raw message