ansible-oracle icon indicating copy to clipboard operation
ansible-oracle copied to clipboard

Python module: cx_Oracle is oracledb now

Open aliensmily opened this issue 1 year ago • 2 comments

Hi,

cx_Oracle (https://oracle.github.io/python-cx_Oracle/) is oracledb (https://oracle.github.io/python-oracledb/) now.

Please consider to support both or to upgrade the modules to oracledb.

Something like that:

try:
  import oracledb as connect_ora
except ImportError:
  oracledb_exists = False
  try:
    import cx_Oracle as connect_ora
  except ImportError:
    cx_oracle_exists = False
  else:
    cx_oracle_exists = True
else:
  oracledb_exists = True
  cx_oracle_exists = False

for using it as "sqlplus / as sysdba" we have done somthing like that:

if oracledb_exists:
	connect_ora.init_oracle_client()
	conn = connect_ora.connect(mode=connect_ora.AUTH_MODE_SYSDBA)
elif not oracledb_exists and cx_oracle_exists:    
	conn = connect_ora.connect('/', mode=connect_ora.SYSDBA)

Thanks.

aliensmily avatar Mar 08 '23 14:03 aliensmily

made a propose for module oracle_user: https://github.com/oravirt/ansible-oracle/compare/master...aliensmily:ansible-oracle:patch-1

aliensmily avatar Mar 08 '23 15:03 aliensmily

This issue is stale because it has been open for 30 days with no activity. Auto close in 30 days.

github-actions[bot] avatar Apr 09 '23 01:04 github-actions[bot]