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

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


The following commit(s) were added to refs/heads/trunk by this push:
     new 180a7a3  [AMBARI-25212] configs.py output and Ambari API output of 
config properties are not in same sorted order.
     new 23aab4c  Merge pull request #2889 from jaysensharma/AMBARI-25212
180a7a3 is described below

commit 180a7a3c1604e36e1b9f869fb42f4863d8f37926
Author: Jay SenSharma <joy.sensha...@gmail.com>
AuthorDate: Tue Mar 26 13:01:43 2019 +1100

    [AMBARI-25212] configs.py output and Ambari API output of config properties 
are not in same sorted order.
---
 ambari-server/src/main/resources/scripts/configs.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ambari-server/src/main/resources/scripts/configs.py 
b/ambari-server/src/main/resources/scripts/configs.py
index 7c7ca0f..5ce7392 100644
--- a/ambari-server/src/main/resources/scripts/configs.py
+++ b/ambari-server/src/main/resources/scripts/configs.py
@@ -20,6 +20,7 @@ limitations under the License.
 
 import optparse
 from optparse import OptionGroup
+from collections import OrderedDict
 import sys
 import urllib2, ssl
 import time
@@ -134,7 +135,7 @@ def get_current_config(cluster, config_type, accessor):
   config_tag = get_config_tag(cluster, config_type, accessor)
   logger.info("### on (Site:{0}, Tag:{1})".format(config_type, config_tag))
   response = accessor(CONFIGURATION_URL.format(cluster, config_type, 
config_tag))
-  config_by_tag = json.loads(response)
+  config_by_tag = json.loads(response, object_pairs_hook=OrderedDict)
   current_config = config_by_tag[ITEMS][0]
   return current_config[PROPERTIES], current_config.get(ATTRIBUTES, {})
 

Reply via email to