ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlun...@apache.org
Subject ambari git commit: AMBARI-15609: Refactor get_stack_to_component() method (Juanjo Marron via jluniya)
Date Sat, 23 Apr 2016 06:11:31 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk d14654bf5 -> 9c53dffb9


AMBARI-15609: Refactor get_stack_to_component() method (Juanjo Marron via jluniya)


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

Branch: refs/heads/trunk
Commit: 9c53dffb95b55d91c594c90ef22f21b5eb0030e5
Parents: d14654b
Author: Jayush Luniya <jluniya@hortonworks.com>
Authored: Fri Apr 22 23:11:22 2016 -0700
Committer: Jayush Luniya <jluniya@hortonworks.com>
Committed: Fri Apr 22 23:11:22 2016 -0700

----------------------------------------------------------------------
 .../libraries/script/script.py                  | 22 ++++++--------------
 .../package/scripts/accumulo_client.py          |  6 ++----
 .../package/scripts/accumulo_script.py          |  5 ++---
 .../0.1.0.2.3/package/scripts/atlas_client.py   |  5 ++---
 .../package/scripts/metadata_server.py          |  5 ++---
 .../0.5.0.2.1/package/scripts/falcon_client.py  |  5 ++---
 .../0.5.0.2.1/package/scripts/falcon_server.py  |  5 ++---
 .../1.4.0.2.0/package/scripts/flume_handler.py  |  4 ++--
 .../0.96.0.2.0/package/scripts/hbase_client.py  |  5 ++---
 .../0.96.0.2.0/package/scripts/hbase_master.py  |  5 ++---
 .../package/scripts/hbase_regionserver.py       |  5 ++---
 .../package/scripts/phoenix_queryserver.py      |  5 ++---
 .../HDFS/2.1.0.2.0/package/scripts/datanode.py  | 15 ++++++-------
 .../2.1.0.2.0/package/scripts/hdfs_client.py    |  5 ++---
 .../2.1.0.2.0/package/scripts/journalnode.py    |  5 ++---
 .../HDFS/2.1.0.2.0/package/scripts/namenode.py  | 14 +++++--------
 .../2.1.0.2.0/package/scripts/nfsgateway.py     |  5 ++---
 .../HDFS/2.1.0.2.0/package/scripts/snamenode.py |  5 ++---
 .../0.12.0.2.0/package/scripts/hcat_client.py   |  5 ++---
 .../0.12.0.2.0/package/scripts/hive_client.py   |  5 ++---
 .../package/scripts/hive_metastore.py           |  5 ++---
 .../0.12.0.2.0/package/scripts/hive_server.py   |  5 ++---
 .../package/scripts/hive_server_interactive.py  |  5 ++---
 .../package/scripts/webhcat_server.py           |  5 ++---
 .../0.8.1.2.2/package/scripts/kafka_broker.py   |  4 ++--
 .../0.5.0.2.2/package/scripts/knox_gateway.py   |  5 ++---
 .../1.0.0.2.3/package/scripts/mahout_client.py  |  4 ++--
 .../4.0.0.2.0/package/scripts/oozie_client.py   |  5 ++---
 .../4.0.0.2.0/package/scripts/oozie_server.py   |  5 ++---
 .../0.12.0.2.0/package/scripts/pig_client.py    |  4 ++--
 .../0.4.0/package/scripts/ranger_admin.py       |  5 ++---
 .../0.4.0/package/scripts/ranger_tagsync.py     |  5 ++---
 .../0.4.0/package/scripts/ranger_usersync.py    |  5 ++---
 .../0.5.0.2.3/package/scripts/kms_server.py     |  4 ++--
 .../0.60.0.2.2/package/scripts/slider_client.py |  4 ++--
 .../package/scripts/job_history_server.py       |  5 ++---
 .../1.2.0.2.2/package/scripts/spark_client.py   |  5 ++---
 .../package/scripts/spark_thrift_server.py      |  5 ++---
 .../1.4.4.2.0/package/scripts/service_check.py  |  4 ++--
 .../1.4.4.2.0/package/scripts/sqoop_client.py   |  4 ++--
 .../0.9.1.2.1/package/scripts/drpc_server.py    |  5 ++---
 .../STORM/0.9.1.2.1/package/scripts/nimbus.py   |  5 ++---
 .../0.9.1.2.1/package/scripts/nimbus_prod.py    |  5 ++---
 .../STORM/0.9.1.2.1/package/scripts/rest_api.py |  5 ++---
 .../0.9.1.2.1/package/scripts/supervisor.py     |  5 ++---
 .../package/scripts/supervisor_prod.py          |  5 ++---
 .../0.9.1.2.1/package/scripts/ui_server.py      |  5 ++---
 .../TEZ/0.4.0.2.1/package/scripts/tez_client.py |  4 ++--
 .../scripts/application_timeline_server.py      |  5 ++---
 .../2.1.0.2.0/package/scripts/historyserver.py  |  5 ++---
 .../package/scripts/mapreduce2_client.py        |  5 ++---
 .../2.1.0.2.0/package/scripts/nodemanager.py    |  5 ++---
 .../package/scripts/resourcemanager.py          |  5 ++---
 .../2.1.0.2.0/package/scripts/yarn_client.py    |  5 ++---
 .../package/scripts/zookeeper_client.py         |  5 ++---
 .../package/scripts/zookeeper_server.py         |  5 ++---
 56 files changed, 123 insertions(+), 185 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-common/src/main/python/resource_management/libraries/script/script.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/script/script.py b/ambari-common/src/main/python/resource_management/libraries/script/script.py
index 193138b..c2d9298 100644
--- a/ambari-common/src/main/python/resource_management/libraries/script/script.py
+++ b/ambari-common/src/main/python/resource_management/libraries/script/script.py
@@ -110,14 +110,7 @@ class Script(object):
 
   # Class variable
   tmp_dir = ""
-
-  def get_stack_to_component(self):
-    """
-    To be overridden by subclasses.
-    Returns a dictionary where the key is a stack name, and the value is the component name used in selecting the version.
-    """
-    return {}
-    
+ 
   def load_structured_out(self):
     Script.structuredOut = {}
     if os.path.exists(self.stroutfile):
@@ -148,14 +141,11 @@ class Script(object):
       Script.structuredOut.update({"errMsg" : "Unable to write to " + self.stroutfile})
       
   def get_component_name(self):
-    stack_name = Script.get_stack_name()
-    stack_to_component = self.get_stack_to_component()
-    
-    if stack_to_component and stack_name:
-      component_name = stack_to_component[stack_name] if stack_name in stack_to_component else None
-      return component_name
-    
-    return None
+    """
+    To be overridden by subclasses.
+     Returns a string with the component name used in selecting the version.
+    """
+    pass
 
   def save_component_version_to_structured_out(self):
     """

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_client.py b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_client.py
index 8f94a59..67ca525 100644
--- a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_client.py
+++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_client.py
@@ -30,10 +30,8 @@ from accumulo_configuration import setup_conf_dir
 
 
 class AccumuloClient(Script):
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name: "accumulo-client"}
-
+  def get_component_name(self):
+    return "accumulo-client"
 
   def install(self, env):
     self.install_packages(env)

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_script.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_script.py b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_script.py
index e210a11..f20e6ff 100644
--- a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_script.py
+++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_script.py
@@ -51,18 +51,17 @@ class AccumuloScript(Script):
     self.component = component
 
 
-  def get_stack_to_component(self):
+  def get_component_name(self):
     """
     Gets the <stack-selector-tool> component name given the script component
     :return:  the name of the component on the stack which is used by
               <stack-selector-tool>
     """
-    import status_params
     if self.component not in self.COMPONENT_TO_STACK_SELECT_MAPPING:
       return None
 
     stack_component = self.COMPONENT_TO_STACK_SELECT_MAPPING[self.component]
-    return {status_params.stack_name: stack_component}
+    return stack_component
 
 
   def install(self, env):

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/atlas_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/atlas_client.py b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/atlas_client.py
index 3715e61..2bdb4c0 100644
--- a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/atlas_client.py
+++ b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/atlas_client.py
@@ -30,9 +30,8 @@ from metadata import metadata
 # todo: support rolling upgrade
 class AtlasClient(Script):
 
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name: "atlas-client"}
+  def get_component_name(self):
+    return "atlas-client"
 
   # ToDo: currently <stack-selector-tool> doesn't contain atlas-client, uncomment this block when
   # ToDo: atlas-client will be available

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata_server.py b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata_server.py
index ae760cb..1b0929f 100644
--- a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata_server.py
+++ b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata_server.py
@@ -30,9 +30,8 @@ from resource_management.libraries.functions import StackFeature
 
 class MetadataServer(Script):
 
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name: "atlas-server"}
+  def get_component_name(self):
+    return "atlas-server"
 
   def install(self, env):
     self.install_packages(env)

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_client.py b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_client.py
index fa869be..64ace1a 100644
--- a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_client.py
+++ b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_client.py
@@ -37,9 +37,8 @@ class FalconClient(Script):
 
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class FalconClientLinux(FalconClient):
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name: "falcon-client"}
+  def get_component_name(self):
+    return "falcon-client"
 
   def install(self, env):
     self.install_packages(env)

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_server.py b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_server.py
index d4935fe..d733d70 100644
--- a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_server.py
+++ b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_server.py
@@ -59,9 +59,8 @@ class FalconServer(Script):
 
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class FalconServerLinux(FalconServer):
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name: "falcon-server"}
+  def get_component_name(self):
+    return "falcon-server"
 
   def install(self, env):
     import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/flume_handler.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/flume_handler.py b/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/flume_handler.py
index cf8d864..205bc78 100644
--- a/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/flume_handler.py
+++ b/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/flume_handler.py
@@ -43,8 +43,8 @@ class FlumeHandler(Script):
 
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class FlumeHandlerLinux(FlumeHandler):
-  def get_stack_to_component(self):
-    return {default("/hostLevelParams/stack_name", None): "flume-server"}
+  def get_component_name(self):
+    return "flume-server"
 
   def install(self, env):
     import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_client.py b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_client.py
index b56efa2..f35a570 100644
--- a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_client.py
+++ b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_client.py
@@ -52,9 +52,8 @@ class HbaseClientWindows(HbaseClient):
 
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class HbaseClientDefault(HbaseClient):
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name: "hbase-client"}
+  def get_component_name(self):
+    return "hbase-client"
 
   def pre_upgrade_restart(self, env, upgrade_type=None):
     import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_master.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_master.py b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_master.py
index 4b4a876..eb650ec 100644
--- a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_master.py
+++ b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_master.py
@@ -70,9 +70,8 @@ class HbaseMasterWindows(HbaseMaster):
 
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class HbaseMasterDefault(HbaseMaster):
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name: "hbase-master"}
+  def get_component_name(self):
+    return "hbase-master"
 
   def pre_upgrade_restart(self, env, upgrade_type=None):
     import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_regionserver.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_regionserver.py b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_regionserver.py
index 4efa739..280fb2c 100644
--- a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_regionserver.py
+++ b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_regionserver.py
@@ -68,9 +68,8 @@ class HbaseRegionServerWindows(HbaseRegionServer):
 
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class HbaseRegionServerDefault(HbaseRegionServer):
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name: "hbase-regionserver"}
+  def get_component_name(self):
+    return "hbase-regionserver"
 
   def pre_upgrade_restart(self, env, upgrade_type=None):
     import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/phoenix_queryserver.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/phoenix_queryserver.py b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/phoenix_queryserver.py
index 93816e3..4e4d4b1 100644
--- a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/phoenix_queryserver.py
+++ b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/phoenix_queryserver.py
@@ -34,9 +34,8 @@ class PhoenixQueryServer(Script):
     self.install_packages(env)
 
 
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name: "phoenix-server"}
+  def get_component_name(self):
+    return "phoenix-server"
 
 
   def configure(self, env):

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py
index 1e0c605..cc1a229 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py
@@ -32,19 +32,16 @@ from utils import get_hdfs_binary
 
 class DataNode(Script):
 
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name : "hadoop-hdfs-datanode"}
+  def get_component_name(self):
+    return "hadoop-hdfs-datanode"
 
   def get_hdfs_binary(self):
     """
-    Get the name or path to the hdfs binary depending on the stack and version.
+    Get the name or path to the hdfs binary depending on the component name.
     """
-    import status_params
-    stack_to_comp = self.get_stack_to_component()
-    if status_params.stack_name in stack_to_comp:
-      return get_hdfs_binary(stack_to_comp[status_params.stack_name])
-    return "hdfs"
+    component_name = self.get_component_name()
+    return get_hdfs_binary(component_name)
+
 
   def install(self, env):
     import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_client.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_client.py
index e3b0070..d9b76b8 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_client.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_client.py
@@ -56,9 +56,8 @@ class HdfsClient(Script):
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class HdfsClientDefault(HdfsClient):
 
-  def get_stack_to_component(self):
-    import status_params
-    return { status_params.stack_name : "hadoop-client"}
+  def get_component_name(self):
+    return "hadoop-client"
 
   def pre_upgrade_restart(self, env, upgrade_type=None):
     import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/journalnode.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/journalnode.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/journalnode.py
index 9929b02..fb1bc09 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/journalnode.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/journalnode.py
@@ -42,9 +42,8 @@ class JournalNode(Script):
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class JournalNodeDefault(JournalNode):
 
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name : "hadoop-hdfs-journalnode"}
+  def get_component_name(self):
+    return "hadoop-hdfs-journalnode"
 
   def pre_upgrade_restart(self, env, upgrade_type=None):
     Logger.info("Executing Stack Upgrade pre-restart")

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py
index bb6f1ca..1b6f347 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py
@@ -68,19 +68,15 @@ except ImportError:
 
 class NameNode(Script):
 
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name : "hadoop-hdfs-namenode"}
+  def get_component_name(self):
+    return "hadoop-hdfs-namenode"
 
   def get_hdfs_binary(self):
     """
-    Get the name or path to the hdfs binary depending on the stack and version.
+    Get the name or path to the hdfs binary depending on the component name.
     """
-    import params
-    stack_to_comp = self.get_stack_to_component()
-    if params.stack_name in stack_to_comp:
-      return get_hdfs_binary(stack_to_comp[params.stack_name])
-    return "hdfs"
+    component_name = self.get_component_name()
+    return get_hdfs_binary(component_name)
 
   def install(self, env):
     import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/nfsgateway.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/nfsgateway.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/nfsgateway.py
index 65cc4fb..17ac837 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/nfsgateway.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/nfsgateway.py
@@ -32,9 +32,8 @@ from resource_management.libraries.functions.stack_features import check_stack_f
 
 class NFSGateway(Script):
 
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name : "hadoop-hdfs-nfs3"}
+  def get_component_name(self):
+    return "hadoop-hdfs-nfs3"
 
   def install(self, env):
     import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/snamenode.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/snamenode.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/snamenode.py
index c8ec843..7ddbc3c 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/snamenode.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/snamenode.py
@@ -64,9 +64,8 @@ class SNameNode(Script):
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class SNameNodeDefault(SNameNode):
 
-  def get_stack_to_component(self):
-    import status_params
-    return { status_params.stack_name : "hadoop-hdfs-secondarynamenode"}
+  def get_component_name(self):
+    return "hadoop-hdfs-secondarynamenode"
 
   def pre_upgrade_restart(self, env, upgrade_type=None):
     Logger.info("Executing Stack Upgrade pre-restart")

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hcat_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hcat_client.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hcat_client.py
index 99c214d..b37698e 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hcat_client.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hcat_client.py
@@ -51,12 +51,11 @@ class HCatClientWindows(HCatClient):
 
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class HCatClientDefault(HCatClient):
-  def get_stack_to_component(self):
+  def get_component_name(self):
     # HCat client doesn't have a first-class entry in <stack-selector-tool>. Since clients always
     # update after daemons, this ensures that the hcat directories are correct on hosts
     # which do not include the WebHCat daemon
-    import status_params
-    return {status_params.stack_name: "hive-webhcat"}
+    return "hive-webhcat"
 
 
   def pre_upgrade_restart(self, env, upgrade_type=None):

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_client.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_client.py
index a87042a..da49450 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_client.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_client.py
@@ -49,9 +49,8 @@ class HiveClientWindows(HiveClient):
 
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class HiveClientDefault(HiveClient):
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name: "hadoop-client"}
+  def get_component_name(self):
+    return "hadoop-client"
 
   def pre_upgrade_restart(self, env, upgrade_type=None):
     Logger.info("Executing Hive client Stack Upgrade pre-restart")

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_metastore.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_metastore.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_metastore.py
index ee82e79..62610f9 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_metastore.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_metastore.py
@@ -83,9 +83,8 @@ class HiveMetastoreWindows(HiveMetastore):
 
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class HiveMetastoreDefault(HiveMetastore):
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name: "hive-metastore"}
+  def get_component_name(self):
+    return "hive-metastore"
 
 
   def status(self, env):

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server.py
index bea00ed..3985956 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server.py
@@ -76,9 +76,8 @@ class HiveServerWindows(HiveServer):
 
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class HiveServerDefault(HiveServer):
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name: "hive-server2"}
+  def get_component_name(self):
+    return "hive-server2"
 
   def start(self, env, upgrade_type=None):
     import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/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 fe05ff6..f548ea3 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
@@ -62,9 +62,8 @@ class HiveServerInteractive(Script):
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class HiveServerInteractiveDefault(HiveServerInteractive):
 
-    def get_stack_to_component(self):
-      import status_params
-      return {status_params.stack_name: "hive-server2-hive2"}
+    def get_component_name(self):
+      return "hive-server2-hive2"
 
     def install(self, env):
       import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/webhcat_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/webhcat_server.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/webhcat_server.py
index 6924040..6815d98 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/webhcat_server.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/webhcat_server.py
@@ -64,9 +64,8 @@ class WebHCatServerWindows(WebHCatServer):
 
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class WebHCatServerDefault(WebHCatServer):
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name: "hive-webhcat"}
+  def get_component_name(self):
+    return "hive-webhcat"
 
   def status(self, env):
     import status_params

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/kafka_broker.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/kafka_broker.py b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/kafka_broker.py
index 5f22bba..d1a4ac5 100644
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/kafka_broker.py
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/kafka_broker.py
@@ -37,8 +37,8 @@ from setup_ranger_kafka import setup_ranger_kafka
 
 class KafkaBroker(Script):
 
-  def get_stack_to_component(self):
-    return {default("/hostLevelParams/stack_name", None) : "kafka-broker"}
+  def get_component_name(self):
+    return "kafka-broker"
 
   def install(self, env):
     self.install_packages(env)

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/knox_gateway.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/knox_gateway.py b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/knox_gateway.py
index 0a37161..0977ade 100644
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/knox_gateway.py
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/knox_gateway.py
@@ -51,9 +51,8 @@ from resource_management.libraries.functions import StackFeature
 
 
 class KnoxGateway(Script):
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name: "knox-server"}
+  def get_component_name(self):
+    return "knox-server"
 
   def install(self, env):
     import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/package/scripts/mahout_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/package/scripts/mahout_client.py b/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/package/scripts/mahout_client.py
index 1fa4625..3486add 100644
--- a/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/package/scripts/mahout_client.py
+++ b/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/package/scripts/mahout_client.py
@@ -29,8 +29,8 @@ from resource_management.libraries.functions.default import default
 
 class MahoutClient(Script):
 
-  def get_stack_to_component(self):
-    return {default("/hostLevelParams/stack_name", None): "mahout-client"}
+  def get_component_name(self):
+    return "mahout-client"
 
 
   def pre_upgrade_restart(self, env, upgrade_type=None):

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_client.py b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_client.py
index d7e9e4d..b3c6537 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_client.py
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_client.py
@@ -31,9 +31,8 @@ from oozie_service import oozie_service
 
 class OozieClient(Script):
 
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name: "oozie-client"}
+  def get_component_name(self):
+    return "oozie-client"
 
   def install(self, env):
     self.install_packages(env)

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server.py b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server.py
index 31cf9e9..cc562ff 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server.py
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server.py
@@ -46,9 +46,8 @@ from check_oozie_server_status import check_oozie_server_status
 
 class OozieServer(Script):
 
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name: "oozie-server"}
+  def get_component_name(self):
+    return "oozie-server"
 
   def install(self, env):
     self.install_packages(env)

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/pig_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/pig_client.py b/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/pig_client.py
index 90a5514..29be252 100644
--- a/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/pig_client.py
+++ b/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/pig_client.py
@@ -42,8 +42,8 @@ class PigClient(Script):
 
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class PigClientLinux(PigClient):
-  def get_stack_to_component(self):
-    return {default("/hostLevelParams/stack_name", None): "hadoop-client"}
+  def get_component_name(self):
+    return "hadoop-client"
 
   def pre_upgrade_restart(self, env, upgrade_type=None):
     import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_admin.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_admin.py b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_admin.py
index 66ae76e..f3c552f 100644
--- a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_admin.py
+++ b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_admin.py
@@ -30,9 +30,8 @@ import os, errno
 
 class RangerAdmin(Script):
 
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name: "ranger-admin"}
+  def get_component_name(self):
+    return "ranger-admin"
 
   def install(self, env):
     self.install_packages(env)

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_tagsync.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_tagsync.py b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_tagsync.py
index 43ecd07..a0600de 100644
--- a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_tagsync.py
+++ b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_tagsync.py
@@ -72,9 +72,8 @@ class RangerTagsync(Script):
       conf_select.select(params.stack_name, "ranger-tagsync", params.version)
       stack_select.select("ranger-tagsync", params.version)
 
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name: "ranger-tagsync"}
+  def get_component_name(self):
+    return "ranger-tagsync"
 
 
 if __name__ == "__main__":

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_usersync.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_usersync.py b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_usersync.py
index 2382d9c..97e8493 100644
--- a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_usersync.py
+++ b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_usersync.py
@@ -70,9 +70,8 @@ class RangerUsersync(Script):
     env.set_params(params)
     upgrade.prestart(env, "ranger-usersync")
 
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name: "ranger-usersync"}
+  def get_component_name(self):
+    return "ranger-usersync"
 
 
 if __name__ == "__main__":

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/kms_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/kms_server.py b/ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/kms_server.py
index e13affc..1cdca71 100755
--- a/ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/kms_server.py
+++ b/ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/kms_server.py
@@ -31,8 +31,8 @@ import upgrade
 
 class KmsServer(Script):
 
-  def get_stack_to_component(self):
-    return {default("/hostLevelParams/stack_name", None): "ranger-kms"}
+  def get_component_name(self):
+    return "ranger-kms"
 
   def install(self, env):
     self.install_packages(env)

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/slider_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/slider_client.py b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/slider_client.py
index ba76259..13f7848 100644
--- a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/slider_client.py
+++ b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/slider_client.py
@@ -34,8 +34,8 @@ class SliderClient(Script):
 
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class SliderClientLinux(SliderClient):
-  def get_stack_to_component(self):
-    return {default("/hostLevelParams/stack_name", None): "slider-client"}
+  def get_component_name(self):
+    return "slider-client"
 
   def pre_upgrade_restart(self, env,  upgrade_type=None):
     import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/job_history_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/job_history_server.py b/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/job_history_server.py
index 7a7f086..33acfa9 100644
--- a/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/job_history_server.py
+++ b/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/job_history_server.py
@@ -68,9 +68,8 @@ class JobHistoryServer(Script):
     check_process_status(status_params.spark_history_server_pid_file)
     
 
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name : "spark-historyserver"}
+  def get_component_name(self):
+    return "spark-historyserver"
 
   def pre_upgrade_restart(self, env, upgrade_type=None):
     import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/spark_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/spark_client.py b/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/spark_client.py
index 740c442..3838061 100644
--- a/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/spark_client.py
+++ b/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/spark_client.py
@@ -44,9 +44,8 @@ class SparkClient(Script):
   def status(self, env):
     raise ClientComponentHasNoStatus()
   
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name : "spark-client"}
+  def get_component_name(self):
+    return "spark-client"
 
   def pre_upgrade_restart(self, env, upgrade_type=None):
     import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/spark_thrift_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/spark_thrift_server.py b/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/spark_thrift_server.py
index f3742be..ef54f86 100644
--- a/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/spark_thrift_server.py
+++ b/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/spark_thrift_server.py
@@ -63,9 +63,8 @@ class SparkThriftServer(Script):
     env.set_params(status_params)
     check_process_status(status_params.spark_thrift_server_pid_file)
 
-  def get_stack_to_component(self):
-    import status_params
-    return { status_params.stack_name : "spark-thriftserver"}
+  def get_component_name(self):
+    return "spark-thriftserver"
 
   def pre_upgrade_restart(self, env, upgrade_type=None):
     import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/service_check.py
index 30184d9..bb503f5 100644
--- a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/service_check.py
+++ b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/service_check.py
@@ -33,8 +33,8 @@ class SqoopServiceCheck(Script):
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class SqoopServiceCheckDefault(SqoopServiceCheck):
 
-  def get_stack_to_component(self):
-    return {default("/hostLevelParams/stack_name", None): "sqoop-server"}
+  def get_component_name(self):
+    return "sqoop-server"
 
   def service_check(self, env):
     import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/sqoop_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/sqoop_client.py b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/sqoop_client.py
index 0e5fd1d..d420fab 100644
--- a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/sqoop_client.py
+++ b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/sqoop_client.py
@@ -46,8 +46,8 @@ class SqoopClient(Script):
 
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class SqoopClientDefault(SqoopClient):
-  def get_stack_to_component(self):
-    return {default("/hostLevelParams/stack_name", None): "sqoop-client"}
+  def get_component_name(self):
+    return "sqoop-client"
 
   def pre_upgrade_restart(self, env, upgrade_type=None):
     import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/drpc_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/drpc_server.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/drpc_server.py
index acd7529..1fc865d 100644
--- a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/drpc_server.py
+++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/drpc_server.py
@@ -36,9 +36,8 @@ from resource_management.libraries.functions.security_commons import build_expec
 
 class DrpcServer(Script):
 
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name: "storm-client"}
+  def get_component_name(self):
+    return "storm-client"
 
   def install(self, env):
     self.install_packages(env)

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/nimbus.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/nimbus.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/nimbus.py
index 296b78f..a0d8c0d 100644
--- a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/nimbus.py
+++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/nimbus.py
@@ -38,9 +38,8 @@ from ambari_commons.os_family_impl import OsFamilyImpl
 from resource_management.core.resources.service import Service
 
 class Nimbus(Script):
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name : "storm-nimbus"}
+  def get_component_name(self):
+    return "storm-nimbus"
 
   def install(self, env):
     self.install_packages(env)

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/nimbus_prod.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/nimbus_prod.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/nimbus_prod.py
index 108b8c1..5f7bf85 100644
--- a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/nimbus_prod.py
+++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/nimbus_prod.py
@@ -31,9 +31,8 @@ from resource_management.libraries.functions import StackFeature
 
 class Nimbus(Script):
 
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name : "storm-nimbus"}
+  def get_component_name(self):
+    return "storm-nimbus"
 
   def install(self, env):
     self.install_packages(env)

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/rest_api.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/rest_api.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/rest_api.py
index db921cb..db482da 100644
--- a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/rest_api.py
+++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/rest_api.py
@@ -38,9 +38,8 @@ class StormRestApi(Script):
   In HDP 2.2, it was removed since the functionality was moved to Storm UI Server.
   """
 
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name : "storm-client"}
+  def get_component_name(self):
+    return "storm-client"
 
   def install(self, env):
     self.install_packages(env)

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/supervisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/supervisor.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/supervisor.py
index c1a0f04..441c9b5 100644
--- a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/supervisor.py
+++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/supervisor.py
@@ -35,9 +35,8 @@ from resource_management.core.resources.service import Service
 
 
 class Supervisor(Script):
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name : "storm-supervisor"}
+  def get_component_name(self):
+    return "storm-supervisor"
 
   def install(self, env):
     self.install_packages(env)

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/supervisor_prod.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/supervisor_prod.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/supervisor_prod.py
index 0577e4b..91e67a7 100644
--- a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/supervisor_prod.py
+++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/supervisor_prod.py
@@ -33,9 +33,8 @@ from resource_management.libraries.functions import StackFeature
 
 class Supervisor(Script):
 
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name : "storm-supervisor"}
+  def get_component_name(self):
+    return "storm-supervisor"
 
   def install(self, env):
     self.install_packages(env)

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/ui_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/ui_server.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/ui_server.py
index b7fec9b..98cb2d4 100644
--- a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/ui_server.py
+++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/ui_server.py
@@ -42,9 +42,8 @@ from resource_management.core.resources.service import Service
 
 class UiServer(Script):
 
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name : "storm-client"}
+  def get_component_name(self):
+    return "storm-client"
 
   def install(self, env):
     self.install_packages(env)

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/tez_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/tez_client.py b/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/tez_client.py
index 9627de7..c79d63b 100644
--- a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/tez_client.py
+++ b/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/tez_client.py
@@ -50,8 +50,8 @@ class TezClient(Script):
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class TezClientLinux(TezClient):
 
-  def get_stack_to_component(self):
-    return {default("/hostLevelParams/stack_name", None) : "hadoop-client"}
+  def get_component_name(self):
+    return "hadoop-client"
 
   def pre_upgrade_restart(self, env, upgrade_type=None):
     import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/application_timeline_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/application_timeline_server.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/application_timeline_server.py
index 3b4d134..e9c9dd0 100644
--- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/application_timeline_server.py
+++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/application_timeline_server.py
@@ -63,9 +63,8 @@ class ApplicationTimelineServerWindows(ApplicationTimelineServer):
 
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class ApplicationTimelineServerDefault(ApplicationTimelineServer):
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name: "hadoop-yarn-timelineserver"}
+  def get_component_name(self):
+    return "hadoop-yarn-timelineserver"
 
   def pre_upgrade_restart(self, env, upgrade_type=None):
     Logger.info("Executing Stack Upgrade pre-restart")

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/historyserver.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/historyserver.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/historyserver.py
index 9b8c5c0..4aa3e29 100644
--- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/historyserver.py
+++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/historyserver.py
@@ -70,9 +70,8 @@ class HistoryserverWindows(HistoryServer):
 
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class HistoryServerDefault(HistoryServer):
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name: "hadoop-mapreduce-historyserver"}
+  def get_component_name(self):
+    return "hadoop-mapreduce-historyserver"
 
   def pre_upgrade_restart(self, env, upgrade_type=None):
     Logger.info("Executing Stack Upgrade pre-restart")

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/mapreduce2_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/mapreduce2_client.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/mapreduce2_client.py
index 6eb04fb..3ea3d75 100644
--- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/mapreduce2_client.py
+++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/mapreduce2_client.py
@@ -51,9 +51,8 @@ class MapReduce2ClientWindows(MapReduce2Client):
 
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class MapReduce2ClientDefault(MapReduce2Client):
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name: "hadoop-client"}
+  def get_component_name(self):
+    return "hadoop-client"
 
   def pre_upgrade_restart(self, env, upgrade_type=None):
     import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/nodemanager.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/nodemanager.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/nodemanager.py
index b1d6351..e5be5c2 100644
--- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/nodemanager.py
+++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/nodemanager.py
@@ -65,9 +65,8 @@ class NodemanagerWindows(Nodemanager):
 
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class NodemanagerDefault(Nodemanager):
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name: "hadoop-yarn-nodemanager"}
+  def get_component_name(self):
+    return "hadoop-yarn-nodemanager"
 
   def pre_upgrade_restart(self, env, upgrade_type=None):
     Logger.info("Executing NodeManager Stack Upgrade pre-restart")

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/resourcemanager.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/resourcemanager.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/resourcemanager.py
index b046c4c..504fa30 100644
--- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/resourcemanager.py
+++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/resourcemanager.py
@@ -98,9 +98,8 @@ class ResourcemanagerWindows(Resourcemanager):
 
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class ResourcemanagerDefault(Resourcemanager):
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name: "hadoop-yarn-resourcemanager"}
+  def get_component_name(self):
+    return "hadoop-yarn-resourcemanager"
 
   def pre_upgrade_restart(self, env, upgrade_type=None):
     Logger.info("Executing Stack Upgrade post-restart")

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn_client.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn_client.py
index 2518f1e..4d65a40 100644
--- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn_client.py
+++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn_client.py
@@ -51,9 +51,8 @@ class YarnClientWindows(YarnClient):
 
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class YarnClientDefault(YarnClient):
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name: "hadoop-client"}
+  def get_component_name(self):
+    return "hadoop-client"
 
   def pre_upgrade_restart(self, env, upgrade_type=None):
     import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_client.py b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_client.py
index 193a7da..de4d6e1 100644
--- a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_client.py
+++ b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_client.py
@@ -55,9 +55,8 @@ class ZookeeperClient(Script):
 
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class ZookeeperClientLinux(ZookeeperClient):
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name : "zookeeper-client"}
+  def get_component_name(self):
+    return "zookeeper-client"
 
   def install(self, env):
     self.install_packages(env)

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c53dffb/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_server.py b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_server.py
index abbe6b7..4fbfae8 100644
--- a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_server.py
+++ b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_server.py
@@ -64,9 +64,8 @@ class ZookeeperServer(Script):
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class ZookeeperServerLinux(ZookeeperServer):
 
-  def get_stack_to_component(self):
-    import status_params
-    return {status_params.stack_name : "zookeeper-server"}
+  def get_component_name(self):
+    return "zookeeper-server"
 
   def install(self, env):
     self.install_packages(env)


Mime
View raw message