Forráskód Böngészése

HUE-2184 [core] Connect to Oracle via Service Name

Christopher Conner 11 éve
szülő
commit
20fd248a7b

+ 1 - 0
desktop/conf.dist/hue.ini

@@ -287,6 +287,7 @@
     #
     #
     # Note that for sqlite3, 'name', below is a path to the filename. For other backends, it is the database name.
     # Note that for sqlite3, 'name', below is a path to the filename. For other backends, it is the database name.
     # Note for Oracle, options={'threaded':true} must be set in order to avoid crashes.
     # Note for Oracle, options={'threaded':true} must be set in order to avoid crashes.
+    # Note for Oracle, you can use the Oracle Service Name by setting "port=0" and then "name=<host>:<port>/<service_name>".
     ## engine=sqlite3
     ## engine=sqlite3
     ## host=
     ## host=
     ## port=
     ## port=

+ 1 - 0
desktop/conf/pseudo-distributed.ini.tmpl

@@ -294,6 +294,7 @@
     #
     #
     # Note that for sqlite3, 'name', below is a a path to the filename. For other backends, it is the database name.
     # Note that for sqlite3, 'name', below is a a path to the filename. For other backends, it is the database name.
     # Note for Oracle, options={'threaded':true} must be set in order to avoid crashes.
     # Note for Oracle, options={'threaded':true} must be set in order to avoid crashes.
+    # Note for Oracle, you can use the Oracle Service Name by setting "port=0" and then "name=<host>:<port>/<service_name>".
     ## engine=sqlite3
     ## engine=sqlite3
     ## host=
     ## host=
     ## port=
     ## port=

+ 10 - 2
desktop/core/src/desktop/conf.py

@@ -41,6 +41,14 @@ def coerce_database(database):
     return str(database)
     return str(database)
 
 
 
 
+def coerce_port(port):
+  port = int(port)
+  if port == 0:
+    return ''
+  else:
+    return port
+
+
 HTTP_HOST = Config(
 HTTP_HOST = Config(
   key="http_host",
   key="http_host",
   help=_("HTTP host to bind to."),
   help=_("HTTP host to bind to."),
@@ -271,8 +279,8 @@ DATABASE = ConfigSection(
     PORT=Config(
     PORT=Config(
       key='port',
       key='port',
       help=_('Database port.'),
       help=_('Database port.'),
-      type=int,
-      default=0,
+      type=coerce_port,
+      default='0',
     ),
     ),
     OPTIONS=Config(
     OPTIONS=Config(
       key='options',
       key='options',