فهرست منبع

AMBARI-12854. Stack Advisor doesn't propose hive.security.authorization.enabled set to true when hive_security_authorization is none (dlysnichenko)

Lisnichenko Dmitro 10 سال پیش
والد
کامیت
8b82c1bd85

+ 12 - 1
ambari-server/src/main/python/upgradeHelper.py

@@ -1519,13 +1519,17 @@ def get_ranger_service_details():
 
 def get_hive_security_authorization_setting():
   # this pattern should be used only once, changes here mimic UpgradeCatalog210.java -> updateRangerHiveConfigs
+  scf = Options.server_config_factory
   response = "None"
+
+  if "hive-env" in scf.items() and "hive_security_authorization" in scf.get_config("hive-env").properties:
+    response = scf.get_config("hive-env").properties["hive_security_authorization"]
+
   old_ranger_catalog = "ranger-hive-plugin-properties"
   old_ranger_setting = "ranger-hive-plugin-enabled"
   hive_server_catalog = "hiveserver2-site"
   hive_sec_property = "hive.security.authorization.enabled"
 
-  scf = Options.server_config_factory
   if scf is not None and old_ranger_catalog in scf.items():
     cfg = scf.get_config(old_ranger_catalog)
     prop = cfg.properties
@@ -1537,6 +1541,13 @@ def get_hive_security_authorization_setting():
     if old_ranger_setting in prop:
       del prop[old_ranger_setting]
 
+  # workaround for buggy stack advisor
+  if "HIVE" in Options.SERVICES and response == "None":
+    if hive_server_catalog not in scf.items():
+      scf.create_config(hive_server_catalog)
+
+    scf.get_config(hive_server_catalog).properties[hive_sec_property] = "false"
+
   return response
 
 

+ 0 - 1
ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.3.json

@@ -55,7 +55,6 @@
           "hive_security_authorization": {
             "value": "{HIVE_SECURITY_AUTHORIZATION}",
             "template": "yes",
-            "override": "no",
             "resolve-dependency": "yes"
           }
         },