Review request for HUE-2184

Review Request #4462 - Created June 19, 2014 and submitted

Chris Conner
old-hue
master
HUE-2184
hue
abec, enricoberti, romain
Patch for HUE-2184 to allow for Hue configuration to connect to Oracle Service Name.
Tested against Oracle backend with Service Name instead of SID.  Confirmed that syncdb, migrate both work and that Hue works after starting up.
  • 0
  • 0
  • 6
  • 0
  • 6
Description From Last Updated
  1. Excellent!!
    
    Maybe we could simplify a tiny bit, this is usually how we manage dynamic parameters. What do you think?
    
    Then let's create a patch for django + add this into C5.1 :)
    https://github.com/django/django/blob/master/django/db/backends/oracle/base.py#L596
    
    http://cx-oracle.readthedocs.org/en/latest/module.html?highlight=makedsn
     cx_Oracle.makedsn(host, port, sid[, service_name])
    
        Return a string suitable for use as the dsn for the connect() method. This string is identical to the strings that are defined by the Oracle names server or defined in the tnsnames.ora file. If you wish to use the service name instead of the sid, do not include a value for the parameter sid and use the keyword parameter service_name instead.
  2. desktop/core/ext-py/Django-1.4.5/django/db/backends/oracle/base.py (Diff revision 1)
     
     
     
     
     
     
     
     
     
    This should get rid of the Database.makedsn duplication:
    
                attrs = {
                    'host' settings_dict['HOST'],
                    'port' int(settings_dict['PORT'])
                }
                if settings_dict['SERVICE_NAME']:
                    attrs['service_name'] = settings_dict['SERVICE_NAME'].strip()
                else:
                    attrs['sid'] = settings_dict['NAME']
                dsn = Database.makedsn(**attrs)
  3. desktop/core/src/desktop/conf.py (Diff revision 1)
     
     
     
     
     
     
     
    could you also update the 
    
    desktop/conf/pseudo-distributed.ini.tmpl
    desktop/conf.dist/hue.ini
    
    with the same info?
  4. Oracle Database Service name. Do not specify a NAME at the same time.
  5. 
      
  1. Awesome! I can commit it!
  2. desktop/core/src/desktop/conf.py (Diff revision 2)
     
     
    I will add 'Do not specify a NAME at the same time.' ;)
  3. 
      
  1. The problem seems to be more around a custom DSN cannot be provided if a PORT is provided. In Hue land we always provide a port.
  2. desktop/core/ext-py/Django-1.4.5/django/db/backends/oracle/base.py (Diff revision 1)
     
     
     
     
     
     
     
     
     
     
    Seems like you should be able to do 'database/service' instead?
  3. 
      
  1. Ship It!
  2. 
      
Review request changed

Status: Closed (submitted)

Loading...