Repository: ambari Updated Branches: refs/heads/trunk d8da5af93 -> 0224b675c
http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-common/src/main/python/resource_management/libraries/functions/curl_krb_request.py ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/curl_krb_request.py b/ambari-common/src/main/python/resource_management/libraries/functions/curl_krb_request.py index a66a25a..5e7f795 100644 --- a/ambari-common/src/main/python/resource_management/libraries/functions/curl_krb_request.py +++ b/ambari-common/src/main/python/resource_management/libraries/functions/curl_krb_request.py @@ -23,7 +23,6 @@ Ambari Agent __all__ = ["curl_krb_request"] import logging import os -import uuid import time import subprocess @@ -47,6 +46,7 @@ logger = logging.getLogger() def curl_krb_request(tmp_dir, keytab, principal, url, cache_file_prefix, krb_exec_search_paths, return_only_http_code, alert_name): + import uuid # Create the kerberos credentials cache (ccache) file and set it in the environment to use # when executing curl. Use the md5 hash of the combination of the principal and keytab file # to generate a (relatively) unique cache filename so that we can use it as needed. http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-common/src/main/python/resource_management/libraries/functions/flume_agent_helper.py ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/flume_agent_helper.py b/ambari-common/src/main/python/resource_management/libraries/functions/flume_agent_helper.py index 94f96ca..d83c06f 100644 --- a/ambari-common/src/main/python/resource_management/libraries/functions/flume_agent_helper.py +++ b/ambari-common/src/main/python/resource_management/libraries/functions/flume_agent_helper.py @@ -18,7 +18,7 @@ See the License for the specific language governing permissions and limitations under the License. """ -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. import glob import os import time http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-common/src/main/python/resource_management/libraries/functions/jmx.py ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/jmx.py b/ambari-common/src/main/python/resource_management/libraries/functions/jmx.py index b32f6aa..a3cfb1b 100644 --- a/ambari-common/src/main/python/resource_management/libraries/functions/jmx.py +++ b/ambari-common/src/main/python/resource_management/libraries/functions/jmx.py @@ -18,7 +18,7 @@ See the License for the specific language governing permissions and limitations under the License. ''' import urllib2 -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. def get_value_from_jmx(qry, property): try: http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-common/src/main/python/resource_management/libraries/functions/ranger_functions.py ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/ranger_functions.py b/ambari-common/src/main/python/resource_management/libraries/functions/ranger_functions.py index eab01ad..7ce33f5 100644 --- a/ambari-common/src/main/python/resource_management/libraries/functions/ranger_functions.py +++ b/ambari-common/src/main/python/resource_management/libraries/functions/ranger_functions.py @@ -20,7 +20,7 @@ limitations under the License. import time import sys from StringIO import StringIO as BytesIO -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. from resource_management.core.logger import Logger import urllib2, base64, httplib from resource_management.core.exceptions import Fail http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-common/src/main/python/resource_management/libraries/functions/ranger_functions_v2.py ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/ranger_functions_v2.py b/ambari-common/src/main/python/resource_management/libraries/functions/ranger_functions_v2.py index b6be4c2..253ee03 100644 --- a/ambari-common/src/main/python/resource_management/libraries/functions/ranger_functions_v2.py +++ b/ambari-common/src/main/python/resource_management/libraries/functions/ranger_functions_v2.py @@ -20,7 +20,7 @@ limitations under the License. import time import sys from StringIO import StringIO as BytesIO -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. from resource_management.core.logger import Logger import urllib2, base64, httplib from resource_management.core.exceptions import Fail http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-common/src/main/python/resource_management/libraries/functions/security_commons.py ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/security_commons.py b/ambari-common/src/main/python/resource_management/libraries/functions/security_commons.py index 1e92f9d..688eba7 100644 --- a/ambari-common/src/main/python/resource_management/libraries/functions/security_commons.py +++ b/ambari-common/src/main/python/resource_management/libraries/functions/security_commons.py @@ -21,7 +21,7 @@ from datetime import datetime, timedelta from resource_management import Execute from tempfile import mkstemp import os -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. FILE_TYPE_XML = 'XML' FILE_TYPE_PROPERTIES = 'PROPERTIES' http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py b/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py index 9f145a8..25f0cd5 100644 --- a/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py +++ b/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py @@ -19,7 +19,6 @@ limitations under the License. Ambari Agent """ -import json import re import os from resource_management.core.environment import Environment @@ -33,6 +32,7 @@ from resource_management.libraries.functions import format from resource_management.libraries.functions import is_empty from resource_management.libraries.functions import namenode_ha_utils +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. JSON_PATH = '/var/lib/ambari-agent/data/hdfs_resources.json' JAR_PATH = '/var/lib/ambari-agent/lib/fast-hdfs-resource.jar' http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/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 3ee1f87..cf46ee2 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 @@ -23,7 +23,6 @@ __all__ = ["Script"] import os import sys -import json import logging import platform from ambari_commons import OSCheck, OSConst @@ -42,6 +41,8 @@ from resource_management.libraries.functions.version import format_hdp_stack_ver from resource_management.libraries.script.config_dictionary import ConfigDictionary, UnknownConfiguration from resource_management.core.resources.system import Execute +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. + if OSCheck.is_windows_family(): from resource_management.libraries.functions.install_hdp_msi import install_windows_msi from resource_management.libraries.functions.reload_windows_env import reload_windows_env http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-server/conf/unix/install-helper.sh ---------------------------------------------------------------------- diff --git a/ambari-server/conf/unix/install-helper.sh b/ambari-server/conf/unix/install-helper.sh index 108f4c2..9dbb2b8 100644 --- a/ambari-server/conf/unix/install-helper.sh +++ b/ambari-server/conf/unix/install-helper.sh @@ -20,11 +20,13 @@ COMMON_DIR="/usr/lib/python2.6/site-packages/ambari_commons" RESOURCE_MANAGEMENT_DIR="/usr/lib/python2.6/site-packages/resource_management" JINJA_DIR="/usr/lib/python2.6/site-packages/ambari_jinja2" +SIMPLEJSON_DIR="/usr/lib/python2.6/site-packages/ambari_simplejson" OLD_COMMON_DIR="/usr/lib/python2.6/site-packages/common_functions" INSTALL_HELPER_AGENT="/var/lib/ambari-agent/install-helper.sh" COMMON_DIR_SERVER="/usr/lib/ambari-server/lib/ambari_commons" RESOURCE_MANAGEMENT_DIR_SERVER="/usr/lib/ambari-server/lib/resource_management" JINJA_SERVER_DIR="/usr/lib/ambari-server/lib/ambari_jinja2" +SIMPLEJSON_SERVER_DIR="/usr/lib/ambari-server/lib/ambari_simplejson" PYTHON_WRAPER_TARGET="/usr/bin/ambari-python-wrap" PYTHON_WRAPER_SOURCE="/var/lib/ambari-server/ambari-python-wrap" @@ -43,6 +45,10 @@ do_install(){ if [ ! -d "$JINJA_DIR" ]; then ln -s "$JINJA_SERVER_DIR" "$JINJA_DIR" fi + # setting simplejson shared resource + if [ ! -d "$SIMPLEJSON_DIR" ]; then + ln -s "$SIMPLEJSON_SERVER_DIR" "$SIMPLEJSON_DIR" + fi # setting python-wrapper script if [ ! -f "$PYTHON_WRAPER_TARGET" ]; then ln -s "$PYTHON_WRAPER_SOURCE" "$PYTHON_WRAPER_TARGET" http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-server/pom.xml ---------------------------------------------------------------------- diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml index 4158d95..ca13c7a 100644 --- a/ambari-server/pom.xml +++ b/ambari-server/pom.xml @@ -36,6 +36,7 @@ <ambari_commons.install.dir>/usr/lib/ambari-server/lib/ambari_commons</ambari_commons.install.dir> <resource_management.install.dir>/usr/lib/ambari-server/lib/resource_management</resource_management.install.dir> <jinja.install.dir>/usr/lib/ambari-server/lib/ambari_jinja2</jinja.install.dir> + <simplejson.install.dir>/usr/lib/ambari-server/lib/ambari_simplejson</simplejson.install.dir> <ambari-web-dir>${basedir}/../ambari-web/public</ambari-web-dir> <ambari-admin-dir>${basedir}/../ambari-admin</ambari-admin-dir> <contrib-views-dir>${basedir}/../contrib/views</contrib-views-dir> @@ -280,6 +281,7 @@ <defaultDirmode>755</defaultDirmode> <defaultUsername>root</defaultUsername> <defaultGroupname>root</defaultGroupname> + <needarch>x86_64</needarch> <mappings> <mapping> <directory>/usr/lib/ambari-server</directory> @@ -339,7 +341,18 @@ </source> </sources> </mapping> - <mapping> + <mapping> + <directory>${simplejson.install.dir}</directory> + <filemode>755</filemode> + <username>root</username> + <groupname>root</groupname> + <sources> + <source> + <location>${project.basedir}/../ambari-common/src/main/python/ambari_simplejson</location> + </source> + </sources> + </mapping> + <mapping> <directory>/usr/sbin</directory> <filemode>755</filemode> <username>root</username> @@ -1103,6 +1116,17 @@ <group>root</group> </mapper> </data> + <data> + <src>${project.basedir}/../ambari-common/src/main/python/ambari_simplejson</src> + <type>directory</type> + <mapper> + <type>perm</type> + <prefix>${simplejson.install.dir}</prefix> + <filemode>755</filemode> + <user>root</user> + <group>root</group> + </mapper> + </data> </dataSet> </configuration> </plugin> http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-server/src/main/python/ambari_server/serverUpgrade.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/python/ambari_server/serverUpgrade.py b/ambari-server/src/main/python/ambari_server/serverUpgrade.py index 3cba2ea..12a82fa 100644 --- a/ambari-server/src/main/python/ambari_server/serverUpgrade.py +++ b/ambari-server/src/main/python/ambari_server/serverUpgrade.py @@ -18,7 +18,7 @@ See the License for the specific language governing permissions and limitations under the License. ''' -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. import os import sys import shutil http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-server/src/main/python/ambari_server/setupSecurity.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/python/ambari_server/setupSecurity.py b/ambari-server/src/main/python/ambari_server/setupSecurity.py index c860ecd..2b408c6 100644 --- a/ambari-server/src/main/python/ambari_server/setupSecurity.py +++ b/ambari-server/src/main/python/ambari_server/setupSecurity.py @@ -19,7 +19,7 @@ limitations under the License. ''' import base64 import fileinput -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. import os import re import shutil http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-server/src/main/python/upgradeHelper.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/python/upgradeHelper.py b/ambari-server/src/main/python/upgradeHelper.py index 82c76bc..fd9c1cc 100644 --- a/ambari-server/src/main/python/upgradeHelper.py +++ b/ambari-server/src/main/python/upgradeHelper.py @@ -85,7 +85,7 @@ import datetime import os.path import logging import shutil -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. import subprocess import time http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/service_check.py index b4cff05..d58626a 100644 --- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/service_check.py +++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/service_check.py @@ -28,7 +28,7 @@ from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl import httplib import urllib -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. import os import random import time http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/flume.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/flume.py b/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/flume.py index 5ba5b03..7d45295 100644 --- a/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/flume.py +++ b/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/flume.py @@ -18,7 +18,7 @@ limitations under the License. """ import glob -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. import os from resource_management import * from resource_management.libraries.functions.flume_agent_helper import is_flume_process_live http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py index ee95493..74d00cb 100644 --- a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py +++ b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py @@ -18,7 +18,7 @@ limitations under the License. """ import status_params -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. from functions import calc_xmn_from_xms http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_checkpoint_time.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_checkpoint_time.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_checkpoint_time.py index 7b20a79..27c45e3 100644 --- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_checkpoint_time.py +++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_checkpoint_time.py @@ -20,7 +20,7 @@ limitations under the License. import time import urllib2 -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. import logging from resource_management.libraries.functions.curl_krb_request import curl_krb_request http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_ha_namenode_health.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_ha_namenode_health.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_ha_namenode_health.py index 40b5694..241fbc6 100644 --- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_ha_namenode_health.py +++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_ha_namenode_health.py @@ -19,7 +19,7 @@ limitations under the License. """ import urllib2 -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. import logging from resource_management.libraries.functions.curl_krb_request import curl_krb_request http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/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 864961e..e557317 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 @@ -19,7 +19,7 @@ limitations under the License. import sys import os -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. import tempfile from resource_management import * from resource_management.libraries.functions import conf_select http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py index 229607d..4e43b3b 100644 --- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py +++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py @@ -19,7 +19,7 @@ limitations under the License. import status_params import utils -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. import os import re http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/utils.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/utils.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/utils.py index 38270e8..59a7b97 100644 --- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/utils.py +++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/utils.py @@ -19,7 +19,7 @@ limitations under the License. import os import re import urllib2 -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. from resource_management import * from resource_management.libraries.functions.format import format http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py index df93633..872f25f 100644 --- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py +++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py @@ -18,7 +18,7 @@ See the License for the specific language governing permissions and limitations under the License. """ -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. import subprocess import socket import time http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py index 6e12dd0..b98cd91 100644 --- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py +++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py @@ -19,7 +19,7 @@ limitations under the License. """ import status_params -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. import os from ambari_commons.constants import AMBARI_SUDO_BINARY http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params_linux.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params_linux.py index b5cd909..9ff7902 100644 --- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params_linux.py +++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params_linux.py @@ -19,7 +19,7 @@ Ambari Agent """ from resource_management import * -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. from resource_management.libraries.functions import format from resource_management.libraries.functions.version import format_hdp_stack_version from resource_management.libraries.functions.default import default http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/kms.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/kms.py b/ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/kms.py index 9028800..9f274bc 100755 --- a/ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/kms.py +++ b/ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/kms.py @@ -21,7 +21,7 @@ limitations under the License. import sys import fileinput import os -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. import urllib2, base64, httplib from StringIO import StringIO as BytesIO from datetime import datetime http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_linux.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_linux.py index 2846919..fa31f04 100644 --- a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_linux.py +++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_linux.py @@ -18,7 +18,7 @@ limitations under the License. """ import re -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. import status_params http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/storm_upgrade.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/storm_upgrade.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/storm_upgrade.py index 3f87694..909c5d6 100644 --- a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/storm_upgrade.py +++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/storm_upgrade.py @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. """ -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. import os from ambari_commons import yaml_utils http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanager_health.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanager_health.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanager_health.py index 80749e6..73e17e6 100644 --- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanager_health.py +++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanager_health.py @@ -18,7 +18,7 @@ See the License for the specific language governing permissions and limitations under the License. """ -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. import socket import urllib2 from ambari_commons import OSCheck http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanagers_summary.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanagers_summary.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanagers_summary.py index 45c8ea6..2d909dc 100644 --- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanagers_summary.py +++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanagers_summary.py @@ -19,7 +19,7 @@ limitations under the License. """ import urllib2 -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. import logging from ambari_commons.urllib_handlers import RefreshHeaderProcessor http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/files/validateYarnComponentStatusWindows.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/files/validateYarnComponentStatusWindows.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/files/validateYarnComponentStatusWindows.py index 073371a..5e2b4d9 100644 --- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/files/validateYarnComponentStatusWindows.py +++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/files/validateYarnComponentStatusWindows.py @@ -20,7 +20,7 @@ limitations under the License. import optparse import subprocess -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. import urllib2 RESOURCEMANAGER = 'rm' http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py index 8e378b5..f4b0969 100644 --- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py +++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py @@ -22,7 +22,7 @@ Ambari Agent from resource_management.libraries.functions.version import compare_versions from resource_management import * import sys -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. import re import subprocess from ambari_commons import os_utils http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py b/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py index efe801b..9979fde 100644 --- a/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py +++ b/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py @@ -20,7 +20,7 @@ Ambari Agent """ -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. import sys import re import traceback http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-server/src/main/resources/custom_actions/scripts/ru_execute_tasks.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/custom_actions/scripts/ru_execute_tasks.py b/ambari-server/src/main/resources/custom_actions/scripts/ru_execute_tasks.py index 32fb57a..e2a078c 100644 --- a/ambari-server/src/main/resources/custom_actions/scripts/ru_execute_tasks.py +++ b/ambari-server/src/main/resources/custom_actions/scripts/ru_execute_tasks.py @@ -21,7 +21,7 @@ Ambari Agent """ import re import os -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. import socket from resource_management.libraries.script import Script http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-ANY/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-ANY/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-ANY/scripts/params.py index 837bd66..52fa53f 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-ANY/scripts/params.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-ANY/scripts/params.py @@ -18,7 +18,7 @@ limitations under the License. """ import collections -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. from resource_management.libraries.functions import conf_select from resource_management.libraries.functions.version import format_hdp_stack_version, compare_versions from ambari_commons.os_check import OSCheck http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/params.py index 35267db..a1fe867 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/params.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/params.py @@ -23,9 +23,6 @@ from resource_management.core.system import System from resource_management.libraries.script.script import Script from resource_management.libraries.functions import default, format -import json -import collections - config = Script.get_config() tmp_dir = Script.get_tmp_dir() sudo = AMBARI_SUDO_BINARY @@ -107,16 +104,3 @@ if has_hbase_masters: #repo params repo_info = config['hostLevelParams']['repo_info'] service_repo_info = default("/hostLevelParams/service_repo_info",None) - -user_to_groups_dict = collections.defaultdict(lambda:[user_group]) -user_to_groups_dict[smoke_user] = [proxyuser_group] -if has_ganglia_server: - user_to_groups_dict[gmond_user] = [gmond_user] - user_to_groups_dict[gmetad_user] = [gmetad_user] -if has_tez: - user_to_groups_dict[tez_user] = [proxyuser_group] - -user_to_gid_dict = collections.defaultdict(lambda:user_group) - -user_list = json.loads(config['hostLevelParams']['user_list']) -group_list = json.loads(config['hostLevelParams']['group_list']) http://git-wip-us.apache.org/repos/asf/ambari/blob/0224b675/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/repo_initialization.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/repo_initialization.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/repo_initialization.py index 32efb5c..bc332fb 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/repo_initialization.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/repo_initialization.py @@ -18,7 +18,7 @@ limitations under the License. """ from resource_management import * from ambari_commons.os_check import OSCheck -import json +import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set. # components_lits = repoName + postfix _UBUNTU_REPO_COMPONENTS_POSTFIX = ["main"]
