浏览代码

HUE-4809 [oozie] Only add trustore paths when they are actually existing

Note: this does not fix the issue when they are needed, but make the error
message clearer by not hiding the root cause.
Romain Rigaux 9 年之前
父节点
当前提交
9ef4bb7
共有 1 个文件被更改,包括 12 次插入7 次删除
  1. 12 7
      apps/beeswax/src/beeswax/hive_site.py

+ 12 - 7
apps/beeswax/src/beeswax/hive_site.py

@@ -132,14 +132,19 @@ def hiveserver2_impersonation_enabled():
   return get_conf().get(_CNF_HIVESERVER2_IMPERSONATION, 'TRUE').upper() == 'TRUE'
 
 def hiveserver2_jdbc_url():
-  urlbase = 'jdbc:hive2://%s:%s/default' % (beeswax.conf.HIVE_SERVER_HOST.get(),
-                                            beeswax.conf.HIVE_SERVER_PORT.get())
+  urlbase = 'jdbc:hive2://%s:%s/default' % (beeswax.conf.HIVE_SERVER_HOST.get(), beeswax.conf.HIVE_SERVER_PORT.get())
+
   if get_conf().get(_CNF_HIVESERVER2_USE_SSL, 'FALSE').upper() == 'TRUE':
-    return '%s;ssl=true;sslTrustStore=%s;trustStorePassword=%s' % (urlbase,
-            get_conf().get(_CNF_HIVESERVER2_TRUSTSTORE_PATH),
-            get_conf().get(_CNF_HIVESERVER2_TRUSTSTORE_PASSWORD))
-  else:
-    return urlbase
+    urlbase += ';ssl=true'
+
+  if get_conf().get(_CNF_HIVESERVER2_TRUSTSTORE_PATH):
+    urlbase += ';sslTrustStore=%s' % get_conf().get(_CNF_HIVESERVER2_TRUSTSTORE_PATH)
+
+  if get_conf().get(_CNF_HIVESERVER2_TRUSTSTORE_PASSWORD):
+    urlbase += ';trustStorePassword=%s' % get_conf().get(_CNF_HIVESERVER2_TRUSTSTORE_PASSWORD)
+
+  return urlbase
+
 
 def hiveserver2_use_ssl():
   return get_conf().get(_CNF_HIVESERVER2_USE_SSL, 'FALSE').upper() == 'TRUE'