Browse Source

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

Robert Levas 9 years ago
parent
commit
c6c4d5ecf6

+ 1 - 1
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')

+ 1 - 2
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>

+ 1 - 1
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": [
         {

+ 7 - 7
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."})

+ 0 - 1
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']

+ 0 - 1
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',

+ 1 - 1
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": {