You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by rl...@apache.org on 2016/04/20 21:48:52 UTC

ambari git commit: AMBARI-15989. exception in ambari agent log for atlas metadata server script (rlevas)

Repository: ambari
Updated Branches:
  refs/heads/trunk 8c6796f38 -> c6c4d5ecf


AMBARI-15989. exception in ambari agent log for atlas metadata server script (rlevas)


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

Branch: refs/heads/trunk
Commit: c6c4d5ecf615da3bfa537e152f7f316196360440
Parents: 8c6796f
Author: Robert Levas <rl...@hortonworks.com>
Authored: Wed Apr 20 15:48:43 2016 -0400
Committer: Robert Levas <rl...@hortonworks.com>
Committed: Wed Apr 20 15:48:43 2016 -0400

----------------------------------------------------------------------
 .../libraries/functions/security_commons.py           |  2 +-
 .../configuration/application-properties.xml          |  3 +--
 .../common-services/ATLAS/0.1.0.2.3/kerberos.json     |  2 +-
 .../0.1.0.2.3/package/scripts/metadata_server.py      | 14 +++++++-------
 .../ATLAS/0.1.0.2.3/package/scripts/params.py         |  1 -
 .../python/stacks/2.3/ATLAS/test_metadata_server.py   |  1 -
 .../kerberos/test_kerberos_descriptor_2_1_3.json      |  2 +-
 7 files changed, 11 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c6c4d5ec/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 47bcee0..4ce2a5a 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
@@ -136,7 +136,7 @@ def get_params_from_filesystem(conf_dir, config_files):
     elif file_type == FILE_TYPE_PROPERTIES:
       with open(conf_dir + os.sep + config_file, 'r') as f:
         config_string = '[root]\n' + f.read()
-      ini_fp = StringIO.StringIO(config_string)
+      ini_fp = StringIO.StringIO(re.sub(r'\\\s*\n', '\\\n ', config_string))
       config = ConfigParser.RawConfigParser()
       config.readfp(ini_fp)
       props = config.items('root')

http://git-wip-us.apache.org/repos/asf/ambari/blob/c6c4d5ec/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml
index a6deda1..95141ca 100644
--- a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml
+++ b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml
@@ -127,8 +127,7 @@
   </property>
   <property>
     <name>atlas.http.authentication.kerberos.name.rules</name>
-    <value>RULE:[1:$1@$0](.*@EXAMPLE.COM)s/@.*//
-      DEFAULT</value>
+    <value>DEFAULT</value>
     <description></description>
   </property>
   <property>

http://git-wip-us.apache.org/repos/asf/ambari/blob/c6c4d5ec/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/kerberos.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/kerberos.json b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/kerberos.json
index 087fc93..85f8207 100644
--- a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/kerberos.json
+++ b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/kerberos.json
@@ -12,7 +12,7 @@
         }
       ],
       "auth_to_local_properties" : [
-        "application-properties/atlas.http.authentication.kerberos.name.rules"
+        "application-properties/atlas.http.authentication.kerberos.name.rules|new_lines_escaped"
       ],
       "components": [
         {

http://git-wip-us.apache.org/repos/asf/ambari/blob/c6c4d5ec/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 a5990a2..8103ec7 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
@@ -104,7 +104,7 @@ class MetadataServer(Script):
                          'atlas.http.authentication.kerberos.keytab']
     props_read_check = ['atlas.authentication.keytab',
                         'atlas.http.authentication.kerberos.keytab']
-    atlas_site_expectations = build_expectations('application-properties',
+    atlas_site_expectations = build_expectations('application',
                                                     props_value_check,
                                                     props_empty_check,
                                                     props_read_check)
@@ -118,17 +118,17 @@ class MetadataServer(Script):
     if not result_issues:  # If all validations passed successfully
       try:
         # Double check the dict before calling execute
-        if ( 'application-properties' not in security_params
-             or 'atlas.authentication.keytab' not in security_params['application-properties']
-             or 'atlas.authentication.principal' not in security_params['application-properties']):
+        if ( 'application' not in security_params
+             or 'atlas.authentication.keytab' not in security_params['application']
+             or 'atlas.authentication.principal' not in security_params['application']):
           self.put_structured_out({"securityState": "UNSECURED"})
           self.put_structured_out(
             {"securityIssuesFound": "Atlas service keytab file or principal are not set property."})
           return
 
-        if ( 'application-properties' not in security_params
-             or 'atlas.http.authentication.kerberos.keytab' not in security_params['application-properties']
-             or 'atlas.http.authentication.kerberos.principal' not in security_params['application-properties']):
+        if ( 'application' not in security_params
+             or 'atlas.http.authentication.kerberos.keytab' not in security_params['application']
+             or 'atlas.http.authentication.kerberos.principal' not in security_params['application']):
           self.put_structured_out({"securityState": "UNSECURED"})
           self.put_structured_out(
             {"securityIssuesFound": "HTTP Authentication keytab file or principal are not set property."})

http://git-wip-us.apache.org/repos/asf/ambari/blob/c6c4d5ec/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py
index 3443016..24f9519 100644
--- a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py
@@ -95,7 +95,6 @@ metadata_host = config['hostname']
 
 # application properties
 application_properties = dict(config['configurations']['application-properties'])
-application_properties['atlas.http.authentication.kerberos.name.rules'] = ' \\ \n'.join(application_properties['atlas.http.authentication.kerberos.name.rules'].splitlines())
 application_properties['atlas.server.bind.address'] = metadata_host
 
 metadata_env_content = config['configurations']['atlas-env']['content']

http://git-wip-us.apache.org/repos/asf/ambari/blob/c6c4d5ec/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py b/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py
index fd3ca81..b1db109 100644
--- a/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py
+++ b/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py
@@ -71,7 +71,6 @@ class TestMetadataServer(RMFTestCase):
       )
       appprops =  dict(self.getConfig()['configurations'][
           'application-properties'])
-      appprops['atlas.http.authentication.kerberos.name.rules'] = ' \\ \n'.join(appprops['atlas.http.authentication.kerberos.name.rules'].splitlines())
       appprops['atlas.server.bind.address'] = 'c6401.ambari.apache.org'
 
       self.assertResourceCalled('PropertiesFile',

http://git-wip-us.apache.org/repos/asf/ambari/blob/c6c4d5ec/ambari-server/src/test/resources/kerberos/test_kerberos_descriptor_2_1_3.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/kerberos/test_kerberos_descriptor_2_1_3.json b/ambari-server/src/test/resources/kerberos/test_kerberos_descriptor_2_1_3.json
index f3dbd38..a9e0bcd 100644
--- a/ambari-server/src/test/resources/kerberos/test_kerberos_descriptor_2_1_3.json
+++ b/ambari-server/src/test/resources/kerberos/test_kerberos_descriptor_2_1_3.json
@@ -1009,7 +1009,7 @@
       "name": "ATLAS_SERVER"
     }],
     "auth_to_local_properties": [
-      "application-properties/atlas.http.authentication.kerberos.name.rules"
+      "application-properties/atlas.http.authentication.kerberos.name.rules|new_lines_escaped"
     ],
     "configurations": [{
       "application-properties": {