def get_db_password(db_name): from webnotes import defs if hasattr(defs, 'get_db_password'): return defs.get_db_password(db_name) elif hasattr(defs, 'db_password'): return defs.db_password else: return db_name
def get_db_password(db_name): """ Get db password from defs """ from webnotes import defs if hasattr(defs, 'get_db_password'): return defs.get_db_password(db_name) if hasattr(defs, 'db_password'): return defs.db_password
def get_db_password(self, db_name, password): """ Return db password. order of importance: 1. password 2. defs.get_db_password() 3. defs.db_password """ # password can be empty string if password: return password if hasattr(defs, 'get_db_password'): return defs.get_db_password(db_name) if hasattr(defs, 'db_password'): return defs.db_password else: return ''