ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject ambari git commit: AMBARI-21415. Fix execution/custom_commands/custom_actions/service_checks. Send clusterHostInfo (aonishuk)
Date Fri, 07 Jul 2017 13:56:21 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-3.0-perf f26436798 -> 063877e47


AMBARI-21415. Fix execution/custom_commands/custom_actions/service_checks. Send clusterHostInfo
(aonishuk)


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

Branch: refs/heads/branch-3.0-perf
Commit: 063877e47763f1426cfc2ef734584ae4565e3a26
Parents: f264367
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Fri Jul 7 16:56:17 2017 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Fri Jul 7 16:56:17 2017 +0300

----------------------------------------------------------------------
 .../src/main/python/ambari_agent/ActionQueue.py |  10 +-
 .../main/python/ambari_agent/ClusterCache.py    |  17 +-
 .../python/ambari_agent/ClusterTopologyCache.py |  46 +++-
 .../python/ambari_agent/CommandStatusDict.py    |   2 +-
 .../ambari_agent/CustomServiceOrchestrator.py   |  57 +++--
 .../src/main/python/ambari_agent/FileCache.py   |   2 +-
 .../src/main/python/ambari_agent/HostInfo.py    |   9 +-
 .../main/python/ambari_agent/RecoveryManager.py |  10 +-
 .../listeners/TopologyEventListener.py          |   4 +-
 .../ambari_agent/TestAgentStompResponses.py     |   1 -
 .../stomp/metadata_after_registration.json      | 219 +++++++++++++++++--
 11 files changed, 297 insertions(+), 80 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/063877e4/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
index f2fc253..b3802b1 100644
--- a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
+++ b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
@@ -302,6 +302,9 @@ class ActionQueue(threading.Thread):
         retryDuration -= delay  # allow one last attempt
         commandresult['stderr'] += "\n\nCommand failed. Retrying command execution ...\n\n"
         logger.info("Retrying command with taskId = {cid} after a wait of {delay}".format(cid=taskId,
delay=delay))
+        if 'agentLevelParams' not in command:
+          command['agentLevelParams'] = {}
+
         command['agentLevelParams']['commandBeingRetried'] = "true"
         time.sleep(delay)
         continue
@@ -357,8 +360,8 @@ class ActionQueue(threading.Thread):
 
     # let ambari know name of custom command
 
-    if command.has_key('custom_command'):
-      roleResult['customCommand'] = command['custom_command']
+    if 'commandParams' in command and command['commandParams'].has_key('custom_command'):
+      roleResult['customCommand'] = command['commandParams']['custom_command']
 
     if 'structuredOut' in commandresult:
       roleResult['structuredOut'] = str(json.dumps(commandresult['structuredOut']))
@@ -369,7 +372,7 @@ class ActionQueue(threading.Thread):
     if status == self.COMPLETED_STATUS:
       # let ambari know that configuration tags were applied
       configHandler = ActualConfigHandler(self.config, self.configTags)
-
+      """
       #update
       if 'commandParams' in command:
         command_params = command['commandParams']
@@ -401,6 +404,7 @@ class ActionQueue(threading.Thread):
                                                 command['hostLevelParams']['clientsToUpdateConfigs'])
         roleResult['configurationTags'] = configHandler.read_actual_component(
             command['role'])
+    """
 
     self.recovery_manager.process_execution_command_result(command, status)
     self.commandStatuses.put_command_status(command, roleResult)

http://git-wip-us.apache.org/repos/asf/ambari/blob/063877e4/ambari-agent/src/main/python/ambari_agent/ClusterCache.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/ClusterCache.py b/ambari-agent/src/main/python/ambari_agent/ClusterCache.py
index a3b84ad..5acdb18 100644
--- a/ambari-agent/src/main/python/ambari_agent/ClusterCache.py
+++ b/ambari-agent/src/main/python/ambari_agent/ClusterCache.py
@@ -33,6 +33,7 @@ class ClusterCache(dict):
   Maintains an in-memory cache and disk cache (for debugging purposes) for
   every cluster. This is useful for having quick access to any of the properties.
   """
+  COMMON_DATA_CLUSTER = '-1'
 
   file_locks = defaultdict(threading.RLock)
 
@@ -57,15 +58,17 @@ class ClusterCache(dict):
       with self.__file_lock:
         with open(self.__current_cache_json_file, 'r') as fp:
           cache_dict = json.load(fp)
-    """
-    for cluster_id, cache in cache_dict.iteritems():
-      immutable_cache = Utils.make_immutable(cache)
-      cache_dict[cluster_id] = immutable_cache
-    """
+
     self.rewrite_cache(cache_dict)
 
+  def get_cluster_indepedent_data(self):
+    return self[ClusterCache.COMMON_DATA_CLUSTER]
+
   def get_cluster_ids(self):
-    return self.keys()
+    cluster_ids = self.keys()[:]
+    if ClusterCache.COMMON_DATA_CLUSTER in cluster_ids:
+      cluster_ids.remove(ClusterCache.COMMON_DATA_CLUSTER)
+    return cluster_ids
 
   def rewrite_cache(self, cache):
     cache_ids_to_delete = []
@@ -107,7 +110,7 @@ class ClusterCache(dict):
       os.makedirs(self.cluster_cache_dir)
 
     with self.__file_lock:
-      with os.fdopen(os.open(self.__current_cache_json_file, os.O_WRONLY | os.O_CREAT, 0o600),
"w") as f:
+      with open(self.__current_cache_json_file, 'w') as f:
         json.dump(self, f, indent=2)
 
   def _get_mutable_copy(self):

http://git-wip-us.apache.org/repos/asf/ambari/blob/063877e4/ambari-agent/src/main/python/ambari_agent/ClusterTopologyCache.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/ClusterTopologyCache.py b/ambari-agent/src/main/python/ambari_agent/ClusterTopologyCache.py
index f138c57..559a956 100644
--- a/ambari-agent/src/main/python/ambari_agent/ClusterTopologyCache.py
+++ b/ambari-agent/src/main/python/ambari_agent/ClusterTopologyCache.py
@@ -45,29 +45,50 @@ class ClusterTopologyCache(ClusterCache):
     self.components_by_key = ImmutableDictionary({})
     self.hostname = hostname.hostname(config)
     self.current_host_ids_to_cluster = {}
+    self.cluster_host_info = None
     super(ClusterTopologyCache, self).__init__(cluster_cache_dir)
 
   def get_cache_name(self):
     return 'topology'
 
   def on_cache_update(self):
+    self.cluster_host_info = None
+
     hosts_to_id = defaultdict(lambda:{})
     components_by_key = defaultdict(lambda:{})
 
     for cluster_id, cluster_topology in self.iteritems():
-      for host_dict in cluster_topology.hosts:
-        hosts_to_id[cluster_id][host_dict.hostId] = host_dict
+      if 'hosts' in cluster_topology:
+        for host_dict in cluster_topology.hosts:
+          hosts_to_id[cluster_id][host_dict.hostId] = host_dict
 
-        if host_dict.hostName == self.hostname:
-          self.current_host_ids_to_cluster[cluster_id] = host_dict.hostId
+          if host_dict.hostName == self.hostname:
+            self.current_host_ids_to_cluster[cluster_id] = host_dict.hostId
 
-      for component_dict in cluster_topology.components:
-        key = "{0}/{1}".format(component_dict.serviceName, component_dict.componentName)
-        components_by_key[cluster_id][key] = component_dict
+      if 'components' in cluster_topology:
+        for component_dict in cluster_topology.components:
+          key = "{0}/{1}".format(component_dict.serviceName, component_dict.componentName)
+          components_by_key[cluster_id][key] = component_dict
 
     self.hosts_to_id = ImmutableDictionary(hosts_to_id)
     self.components_by_key = ImmutableDictionary(components_by_key)
 
+  def get_cluster_host_info(self, cluster_id):
+    """
+    Get dictionary used in commands as clusterHostInfo
+    """
+    if self.cluster_host_info is not None:
+      return self.cluster_host_info
+
+    cluster_host_info = defaultdict(lambda: [])
+    for component_dict in self[cluster_id].components:
+      component_name = component_dict.componentName
+      hostnames = [self.hosts_to_id[cluster_id][host_id].hostName for host_id in component_dict.hostIds]
+      cluster_host_info[component_name.lower()+"_hosts"] += hostnames
+
+    self.cluster_host_info = cluster_host_info
+    return cluster_host_info
+
   def get_component_info_by_key(self, cluster_id, service_name, component_name):
     """
     Find component by service_name and component_name in list of component dictionaries.
@@ -119,11 +140,15 @@ class ClusterTopologyCache(ClusterCache):
     mutable_dict = self._get_mutable_copy()
 
     for cluster_id, cluster_updates_dict in cache_update.iteritems():
+      # adding a new cluster via UPDATE
       if not cluster_id in mutable_dict:
-        logger.error("Cannot do topology update for cluster cluster_id={0}, because do not
have information about the cluster")
+        mutable_dict[cluster_id] = cluster_updates_dict
         continue
 
       if 'hosts' in cluster_updates_dict:
+        if not 'hosts' in mutable_dict[cluster_id]:
+          mutable_dict[cluster_id]['hosts'] = []
+
         hosts_mutable_list = mutable_dict[cluster_id]['hosts']
         for host_updates_dict in cluster_updates_dict['hosts']:
           host_mutable_dict = ClusterTopologyCache._find_host_by_id_in_dict(hosts_mutable_list,
host_updates_dict['hostId'])
@@ -133,6 +158,9 @@ class ClusterTopologyCache(ClusterCache):
             hosts_mutable_list.append(host_updates_dict)
 
       if 'components' in cluster_updates_dict:
+        if not 'components' in mutable_dict[cluster_id]:
+          mutable_dict[cluster_id]['components'] = []
+
         components_mutable_list = mutable_dict[cluster_id]['components']
         for component_updates_dict in cluster_updates_dict['components']:
           component_mutable_dict = ClusterTopologyCache._find_component_in_dict(components_mutable_list,
component_updates_dict['serviceName'], component_updates_dict['componentName'])
@@ -160,7 +188,7 @@ class ClusterTopologyCache(ClusterCache):
 
     for cluster_id, cluster_updates_dict in cache_update.iteritems():
       if not cluster_id in mutable_dict:
-        logger.error("Cannot do topology delete for cluster cluster_id={0}, because do not
have information about the cluster")
+        logger.error("Cannot do topology delete for cluster cluster_id={0}, because do not
have information about the cluster".format(cluster_id))
         continue
 
       if 'hosts' in cluster_updates_dict:

http://git-wip-us.apache.org/repos/asf/ambari/blob/063877e4/ambari-agent/src/main/python/ambari_agent/CommandStatusDict.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/CommandStatusDict.py b/ambari-agent/src/main/python/ambari_agent/CommandStatusDict.py
index ff526e3..f6d304c 100644
--- a/ambari-agent/src/main/python/ambari_agent/CommandStatusDict.py
+++ b/ambari-agent/src/main/python/ambari_agent/CommandStatusDict.py
@@ -86,7 +86,7 @@ class CommandStatusDict():
             self.reported_reports.add(key)
           else:
             in_progress_report = self.generate_in_progress_report(command, report)
-            resultReports.append(in_progress_report)
+            resultReports[cluster_id].append(in_progress_report)
         elif command ['commandType'] in [ActionQueue.AUTO_EXECUTION_COMMAND]:
           logger.debug("AUTO_EXECUTION_COMMAND task deleted " + str(command['commandId']))
           self.reported_reports.add(key)

http://git-wip-us.apache.org/repos/asf/ambari/blob/063877e4/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
index 6389878..8bc050a 100644
--- a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
+++ b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
@@ -24,7 +24,6 @@ import ambari_simplejson as json
 import sys
 from ambari_commons import shell
 import threading
-import copy
 
 from FileCache import FileCache
 from AgentException import AgentException
@@ -315,7 +314,7 @@ class CustomServiceOrchestrator():
       script = command['commandParams']['script']
       timeout = int(command['commandParams']['command_timeout'])
 
-      server_url_prefix = command['clusterLevelParams']['jdk_location']
+      server_url_prefix = command['ambariLevelParams']['jdk_location']
 
       # Status commands have no taskId nor roleCommand
       if not is_status_command:
@@ -333,7 +332,7 @@ class CustomServiceOrchestrator():
         hook_dir = None
       else:
         if command_name == self.CUSTOM_COMMAND_COMMAND:
-          command_name = command['hostLevelParams']['custom_command']
+          command_name = command['commandParams']['custom_command']
 
         # forces a hash challenge on the directories to keep them updated, even
         # if the return type is not used
@@ -363,7 +362,7 @@ class CustomServiceOrchestrator():
       # If command contains credentialStoreEnabled, then
       # generate the JCEKS file for the configurations.
       credentialStoreEnabled = False
-      if 'credentialStoreEnabled' in command['serviceLevelParams']:
+      if 'serviceLevelParams' in command and 'credentialStoreEnabled' in command['serviceLevelParams']:
         credentialStoreEnabled = (command['serviceLevelParams']['credentialStoreEnabled']
== "true")
 
       if credentialStoreEnabled == True:
@@ -454,29 +453,43 @@ class CustomServiceOrchestrator():
     return None
 
   def generate_command(self, command_header):
-    service_name = command_header['serviceName']
-    component_name = command_header['role']
     cluster_id = str(command_header['clusterId'])
 
-    metadata_cache = self.metadata_cache[cluster_id]
-    configurations_cache = self.configurations_cache[cluster_id]
-    host_level_params_cache = self.host_level_params_cache[cluster_id]
+    if cluster_id != '-1' and cluster_id != 'null':
+      service_name = command_header['serviceName']
+      component_name = command_header['role']
 
-    component_dict = self.topology_cache.get_component_info_by_key(cluster_id, service_name,
component_name)
+      metadata_cache = self.metadata_cache[cluster_id]
+      configurations_cache = self.configurations_cache[cluster_id]
+      host_level_params_cache = self.host_level_params_cache[cluster_id]
 
-    command_dict = {
-      'clusterLevelParams': metadata_cache.clusterLevelParams,
-      'serviceLevelParams': metadata_cache.serviceLevelParams[service_name],
-      'hostLevelParams': host_level_params_cache,
-      'componentLevelParams': component_dict.componentLevelParams,
-      'commandParams': component_dict.commandParams
-    }
-    command_dict.update(configurations_cache)
+      command_dict = {
+        'clusterLevelParams': metadata_cache.clusterLevelParams,
+        'hostLevelParams': host_level_params_cache,
+        'clusterHostInfo': self.topology_cache.get_cluster_host_info(cluster_id),
+        'agentLevelParams': {'hostname': self.topology_cache.get_current_host_info(cluster_id)['hostName']}
+      }
+
+      if service_name is not None and service_name != 'null':
+        command_dict['serviceLevelParams'] = metadata_cache.serviceLevelParams[service_name]
+
+      component_dict = self.topology_cache.get_component_info_by_key(cluster_id, service_name,
component_name)
+      if component_dict is not None:
+        command_dict.update({
+          'componentLevelParams': component_dict.componentLevelParams,
+          'commandParams': component_dict.commandParams
+        })
 
-    command_dict['agentLevelParams'] = {
+      command_dict.update(configurations_cache)
+    else:
+      command_dict = {'agentLevelParams': {}}
+
+    command_dict['ambariLevelParams'] = self.metadata_cache.get_cluster_indepedent_data().clusterLevelParams
+
+    command_dict['agentLevelParams'].update({
       'public_hostname': self.public_fqdn,
       'agentCacheDir': self.config.get('agent', 'cache_dir'),
-    }
+    })
     command_dict['agentLevelParams']["agentConfigParams"] = {
       "agent": {
         "parallel_execution": self.config.get_parallel_exec_option(),
@@ -484,7 +497,7 @@ class CustomServiceOrchestrator():
       }
     }
 
-    command = Utils.update_nested(command_dict, command_header)
+    command = Utils.update_nested(Utils.get_mutable_copy(command_dict), command_header)
     return command
 
   def requestComponentStatus(self, command_header):
@@ -542,8 +555,6 @@ class CustomServiceOrchestrator():
       file_path = os.path.join(self.tmp_dir, "status_command.json")
     else:
       task_id = command['taskId']
-      if 'clusterHostInfo' in command and command['clusterHostInfo'] and not retry:
-        command['clusterHostInfo'] = self.decompressClusterHostInfo(command['clusterHostInfo'])
       file_path = os.path.join(self.tmp_dir, "command-{0}.json".format(task_id))
       if command_type == ActionQueue.AUTO_EXECUTION_COMMAND:
         file_path = os.path.join(self.tmp_dir, "auto_command-{0}.json".format(task_id))

http://git-wip-us.apache.org/repos/asf/ambari/blob/063877e4/ambari-agent/src/main/python/ambari_agent/FileCache.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/FileCache.py b/ambari-agent/src/main/python/ambari_agent/FileCache.py
index 3bff613..0e598e9 100644
--- a/ambari-agent/src/main/python/ambari_agent/FileCache.py
+++ b/ambari-agent/src/main/python/ambari_agent/FileCache.py
@@ -83,7 +83,7 @@ class FileCache():
     Returns a base directory for hooks
     """
     try:
-      hooks_subpath = command['serviceLevelParams']['hooks_folder']
+      hooks_subpath = command['clusterLevelParams']['hooks_folder']
     except KeyError:
       return None
     subpath = os.path.join(self.STACKS_CACHE_DIRECTORY, hooks_subpath)

http://git-wip-us.apache.org/repos/asf/ambari/blob/063877e4/ambari-agent/src/main/python/ambari_agent/HostInfo.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/HostInfo.py b/ambari-agent/src/main/python/ambari_agent/HostInfo.py
index b6db1f2..77f8a16 100644
--- a/ambari-agent/src/main/python/ambari_agent/HostInfo.py
+++ b/ambari-agent/src/main/python/ambari_agent/HostInfo.py
@@ -297,14 +297,15 @@ class HostInfoLinux(HostInfo):
       logger.exception('Unable to get information about JCE')
       return None
 
-  def register(self, dict, runExpensiveChecks=False):
+  def register(self, dict, runExpensiveChecks=False, checkJavaProcs=False):
     """ Return various details about the host"""
 
     dict['hostHealth'] = {}
 
-    java = []
-    self.javaProcs(java)
-    dict['hostHealth']['activeJavaProcs'] = java
+    if checkJavaProcs:
+      java = []
+      self.javaProcs(java)
+      dict['hostHealth']['activeJavaProcs'] = java
 
     liveSvcs = []
     self.checkLiveServices(self.DEFAULT_LIVE_SERVICES, liveSvcs)

http://git-wip-us.apache.org/repos/asf/ambari/blob/063877e4/ambari-agent/src/main/python/ambari_agent/RecoveryManager.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/RecoveryManager.py b/ambari-agent/src/main/python/ambari_agent/RecoveryManager.py
index 19f163e..1d72bc4 100644
--- a/ambari-agent/src/main/python/ambari_agent/RecoveryManager.py
+++ b/ambari-agent/src/main/python/ambari_agent/RecoveryManager.py
@@ -96,7 +96,6 @@ class RecoveryManager:
     self.__active_command_lock = threading.RLock()
     self.__cache_lock = threading.RLock()
     self.active_command_count = 0
-    self.paused = False
     self.cluster_id = None
 
     if not os.path.exists(cache_dir):
@@ -126,11 +125,6 @@ class RecoveryManager:
   def has_active_command(self):
     return self.active_command_count > 0
 
-  def set_paused(self, paused):
-    if self.paused != paused:
-      logger.debug("RecoveryManager is transitioning from isPaused = " + str(self.paused)
+ " to " + str(paused))
-    self.paused = paused
-
   def enabled(self):
     return self.recovery_enabled
 
@@ -746,8 +740,8 @@ class RecoveryManager:
     """
     Get command dictionary by component name and command_name
     """
-    if self.paused:
-      logger.info("Recovery is paused, likely tasks waiting in pipeline for this host.")
+    if self.has_active_command():
+      logger.info("Recovery is paused, tasks waiting in pipeline for this host.")
       return None
 
     if self.enabled():

http://git-wip-us.apache.org/repos/asf/ambari/blob/063877e4/ambari-agent/src/main/python/ambari_agent/listeners/TopologyEventListener.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/listeners/TopologyEventListener.py
b/ambari-agent/src/main/python/ambari_agent/listeners/TopologyEventListener.py
index 19a1d32..d1c644c 100644
--- a/ambari-agent/src/main/python/ambari_agent/listeners/TopologyEventListener.py
+++ b/ambari-agent/src/main/python/ambari_agent/listeners/TopologyEventListener.py
@@ -51,10 +51,10 @@ class TopologyEventListener(EventListener):
       self.topology_cache.hash = message['hash']
     elif event_type == 'UPDATE':
       self.topology_cache.cache_update(message['clusters'])
-      self.topology_cache.hash = message['hash']
+      self.topology_cache.hash = "abc" #message['hash']
     elif event_type == 'DELETE':
       self.topology_cache.cache_delete(message['clusters'])
-      self.topology_cache.hash = message['hash']
+      self.topology_cache.hash = "abcd" #message['hash']
     else:
       logger.error("Unknown event type '{0}' for topology event")
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/063877e4/ambari-agent/src/test/python/ambari_agent/TestAgentStompResponses.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/ambari_agent/TestAgentStompResponses.py b/ambari-agent/src/test/python/ambari_agent/TestAgentStompResponses.py
index 26c40b3..88f1e69 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestAgentStompResponses.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestAgentStompResponses.py
@@ -132,7 +132,6 @@ class TestAgentStompResponses(BaseStompServerTestCase):
 
 
     self.assertTrue('mounts' in host_status_report)
-    self.assertTrue('activeJavaProcs' in host_status_report['agentEnv']['hostHealth'])
     self.assertEquals(initializer_module.topology_cache['0']['hosts'][0]['hostName'], 'c6401.ambari.apache.org')
     self.assertEquals(initializer_module.metadata_cache['0']['status_commands_to_run'], ('STATUS',))
     self.assertEquals(initializer_module.configurations_cache['0']['configurations']['zoo.cfg']['clientPort'],
'2181')

http://git-wip-us.apache.org/repos/asf/ambari/blob/063877e4/ambari-agent/src/test/python/ambari_agent/dummy_files/stomp/metadata_after_registration.json
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/ambari_agent/dummy_files/stomp/metadata_after_registration.json
b/ambari-agent/src/test/python/ambari_agent/dummy_files/stomp/metadata_after_registration.json
index c1aba28..6e5fc00 100644
--- a/ambari-agent/src/test/python/ambari_agent/dummy_files/stomp/metadata_after_registration.json
+++ b/ambari-agent/src/test/python/ambari_agent/dummy_files/stomp/metadata_after_registration.json
@@ -1,44 +1,221 @@
 {
-  "hash": "c2bea6695221368416b2412fec2ba0d7",
+  "hash": "9f8a0520670d08cc2bd38f2a6f37e8a83fb5fe980c9e26410efe46ff4131903ea43f52d6838c3b9b82f993f0b4bc80f349c1f97733fd74183252eac1f0bdac52",
   "clusters": {
     "0": {
       "clusterLevelParams": {
-        "jdk_location": "http://gc6401:8080/resources/",
-        "not_managed_hdfs_path_list": "[\"/mr-history/done\",\"/app-logs\",\"/tmp\"]",
-        "agent_stack_retry_on_unavailability": "false",
-        "ambari_db_rca_url": "jdbc:postgresql://gc6401/ambarirca",
+        "cluster_name": "c1",
+        "not_managed_hdfs_path_list": "[\"/tmp\"]",
         "stack_name": "HDP",
-        "java_version": "8",
-        "ambari_db_rca_password": "mapred",
         "group_list": "[\"hadoop\",\"users\"]",
-        "host_sys_prepped": "false",
-        "oracle_jdbc_url": "http://gc6401:8080/resources//ojdbc6.jar",
-        "jdk_name": "jdk-8u112-linux-x64.tar.gz",
-        "ambari_db_rca_username": "mapred",
-        "mysql_jdbc_url": "http://gc6401:8080/resources//mysql-connector-java.jar",
-        "agent_stack_retry_count": "5",
-        "db_driver_filename": "mysql-connector-java.jar",
-        "jce_name": "jce_policy-8.zip",
         "user_groups": "{}",
         "stack_version": "2.6",
-        "db_name": "ambari",
-        "ambari_db_rca_driver": "org.postgresql.Driver",
-        "java_home": "/usr/jdk64/jdk1.8.0_112",
-        "user_list": "[\"zookeeper\",\"ambari-qa\",\"hdfs\",\"yarn\",\"mapred\"]",
-        "hooks_folder": "HDP/2.0.6/hooks",
-        "cluster_name": "cl1"
+        "user_list": "[\"zookeeper\",\"ambari-qa\",\"hdfs\"]"
       },
       "serviceLevelParams": {
+        "SQOOP": {
+          "credentialStoreEnabled": false,
+          "status_commands_timeout": 300,
+          "version": "1.4.6",
+          "service_package_folder": "common-services/SQOOP/1.4.4.2.0/package"
+        },
+        "AMBARI_METRICS": {
+          "credentialStoreEnabled": false,
+          "status_commands_timeout": 600,
+          "version": "0.1.0",
+          "service_package_folder": "common-services/AMBARI_METRICS/0.1.0/package"
+        },
+        "KERBEROS": {
+          "credentialStoreEnabled": false,
+          "status_commands_timeout": 300,
+          "version": "1.10.3-10",
+          "service_package_folder": "common-services/KERBEROS/1.10.3-10/package"
+        },
+        "RANGER": {
+          "credentialStoreEnabled": false,
+          "status_commands_timeout": 300,
+          "version": "0.7.0",
+          "service_package_folder": "common-services/RANGER/0.4.0/package"
+        },
+        "ZEPPELIN": {
+          "credentialStoreEnabled": false,
+          "status_commands_timeout": 300,
+          "version": "0.7.0",
+          "service_package_folder": "common-services/ZEPPELIN/0.6.0.2.5/package"
+        },
+        "ATLAS": {
+          "credentialStoreEnabled": false,
+          "status_commands_timeout": 300,
+          "version": "0.8.0",
+          "service_package_folder": "common-services/ATLAS/0.1.0.2.3/package"
+        },
+        "KNOX": {
+          "credentialStoreEnabled": false,
+          "status_commands_timeout": 300,
+          "version": "0.12.0",
+          "service_package_folder": "common-services/KNOX/0.5.0.2.2/package"
+        },
+        "GANGLIA": {
+          "credentialStoreEnabled": false,
+          "status_commands_timeout": null,
+          "version": "3.5.0",
+          "service_package_folder": "common-services/GANGLIA/3.5.0/package"
+        },
+        "RANGER_KMS": {
+          "credentialStoreEnabled": false,
+          "status_commands_timeout": 300,
+          "version": "0.7.0",
+          "service_package_folder": "common-services/RANGER_KMS/0.5.0.2.3/package"
+        },
+        "FLUME": {
+          "credentialStoreEnabled": false,
+          "status_commands_timeout": 300,
+          "version": "1.5.2",
+          "service_package_folder": "common-services/FLUME/1.4.0.2.0/package"
+        },
+        "DRUID": {
+          "credentialStoreEnabled": false,
+          "status_commands_timeout": 300,
+          "version": "0.9.2",
+          "service_package_folder": "common-services/DRUID/0.9.2/package"
+        },
+        "YARN": {
+          "credentialStoreEnabled": false,
+          "status_commands_timeout": 300,
+          "version": "2.7.3",
+          "service_package_folder": "common-services/YARN/2.1.0.2.0/package"
+        },
+        "PIG": {
+          "credentialStoreEnabled": false,
+          "status_commands_timeout": 300,
+          "version": "0.16.0",
+          "service_package_folder": "common-services/PIG/0.12.0.2.0/package"
+        },
+        "MAHOUT": {
+          "credentialStoreEnabled": false,
+          "status_commands_timeout": 300,
+          "version": "0.9.0",
+          "service_package_folder": "common-services/MAHOUT/1.0.0.2.3/package"
+        },
+        "TEZ": {
+          "credentialStoreEnabled": false,
+          "status_commands_timeout": 300,
+          "version": "0.7.0",
+          "service_package_folder": "common-services/TEZ/0.4.0.2.1/package"
+        },
+        "MAPREDUCE2": {
+          "credentialStoreEnabled": false,
+          "status_commands_timeout": 300,
+          "version": "2.7.3",
+          "service_package_folder": "common-services/YARN/2.1.0.2.0/package"
+        },
+        "OOZIE": {
+          "credentialStoreEnabled": true,
+          "status_commands_timeout": 300,
+          "version": "4.2.0",
+          "service_package_folder": "common-services/OOZIE/4.0.0.2.0/package"
+        },
+        "SPARK": {
+          "credentialStoreEnabled": false,
+          "status_commands_timeout": 300,
+          "version": "1.6.x",
+          "service_package_folder": "common-services/SPARK/1.2.1/package"
+        },
+        "ACCUMULO": {
+          "credentialStoreEnabled": false,
+          "status_commands_timeout": 300,
+          "version": "1.7.0",
+          "service_package_folder": "common-services/ACCUMULO/1.6.1.2.2.0/package"
+        },
+        "LOGSEARCH": {
+          "credentialStoreEnabled": true,
+          "status_commands_timeout": 300,
+          "version": "0.5.0",
+          "service_package_folder": "common-services/LOGSEARCH/0.5.0/package"
+        },
+        "SPARK2": {
+          "credentialStoreEnabled": false,
+          "status_commands_timeout": 300,
+          "version": "2.x",
+          "service_package_folder": "common-services/SPARK2/2.0.0/package"
+        },
+        "SLIDER": {
+          "credentialStoreEnabled": false,
+          "status_commands_timeout": 300,
+          "version": "0.92.0",
+          "service_package_folder": "common-services/SLIDER/0.60.0.2.2/package"
+        },
+        "STORM": {
+          "credentialStoreEnabled": false,
+          "status_commands_timeout": 300,
+          "version": "1.1.0",
+          "service_package_folder": "common-services/STORM/0.9.1/package"
+        },
+        "FALCON": {
+          "credentialStoreEnabled": false,
+          "status_commands_timeout": 300,
+          "version": "0.10.0",
+          "service_package_folder": "common-services/FALCON/0.5.0.2.1/package"
+        },
         "HDFS": {
           "credentialStoreEnabled": false,
           "status_commands_timeout": 300,
           "version": "2.7.3",
           "service_package_folder": "common-services/HDFS/2.1.0.2.0/package"
+        },
+        "ZOOKEEPER": {
+          "credentialStoreEnabled": false,
+          "status_commands_timeout": 300,
+          "version": "3.4.6",
+          "service_package_folder": "common-services/ZOOKEEPER/3.4.5/package"
+        },
+        "HIVE": {
+          "credentialStoreEnabled": true,
+          "status_commands_timeout": 300,
+          "version": "1.2.1000",
+          "service_package_folder": "common-services/HIVE/0.12.0.2.0/package"
+        },
+        "KAFKA": {
+          "credentialStoreEnabled": false,
+          "status_commands_timeout": 300,
+          "version": "0.10.1",
+          "service_package_folder": "common-services/KAFKA/0.8.1/package"
+        },
+        "AMBARI_INFRA": {
+          "credentialStoreEnabled": false,
+          "status_commands_timeout": 300,
+          "version": "0.1.0",
+          "service_package_folder": "common-services/AMBARI_INFRA/0.1.0/package"
+        },
+        "HBASE": {
+          "credentialStoreEnabled": false,
+          "status_commands_timeout": 300,
+          "version": "1.1.2",
+          "service_package_folder": "common-services/HBASE/0.96.0.2.0/package"
         }
       },
       "status_commands_to_run": [
         "STATUS"
       ]
+    },
+    "-1": {
+      "clusterLevelParams": {
+        "jdk_location": "http://gc6401:8080/resources/",
+        "agent_stack_retry_count": "5",
+        "db_driver_filename": "mysql-connector-java.jar",
+        "agent_stack_retry_on_unavailability": "false",
+        "ambari_db_rca_url": "jdbc:postgresql://gc6401/ambarirca",
+        "jce_name": "jce_policy-8.zip",
+        "java_version": "8",
+        "ambari_db_rca_password": "mapred",
+        "host_sys_prepped": "false",
+        "db_name": "ambari",
+        "oracle_jdbc_url": "http://gc6401:8080/resources//ojdbc6.jar",
+        "ambari_db_rca_driver": "org.postgresql.Driver",
+        "ambari_db_rca_username": "mapred",
+        "jdk_name": "jdk-8u112-linux-x64.tar.gz",
+        "java_home": "/usr/jdk64/jdk1.8.0_112",
+        "mysql_jdbc_url": "http://gc6401:8080/resources//mysql-connector-java.jar"
+      }
     }
   }
 }
\ No newline at end of file


Mime
View raw message