import pooler
import netsvc
+import sql_db
from service import security
from osv import osv
self.cwd = '/'
self.cwd_node = None
self.rnfr = None
- self._log = logging.getLogger('FTP.fs')
+ self._log = logging.getLogger(__name__)
# Ok
def db_list(self):
db, cr = None, None
try:
try:
- db = pooler.get_db_only(db_name)
+ db = sql_db.db_connect(db_name)
cr = db.cursor()
cr.execute("SELECT 1 FROM pg_class WHERE relkind = 'r' AND relname = 'ir_module_module'")
if not cr.fetchone():
ret = child.open_data(cr, mode)
cr.commit()
+ assert ret, "Cannot create descriptor for %r: %r" % (child, ret)
return ret
except EnvironmentError:
raise
- except Exception,e:
+ except Exception:
self._log.exception('Cannot locate item %s at node %s', objname, repr(node))
pass
try:
child = node.create_child(cr, objname, data=None)
ret = child.open_data(cr, mode)
+ assert ret, "cannot create descriptor for %r" % child
cr.commit()
return ret
except EnvironmentError:
def rename(self, src, datacr):
""" Renaming operation, the effect depends on the src:
* A file: read, create and remove
- * A directory: change the parent and reassign childs to ressource
+ * A directory: change the parent and reassign children to ressource
"""
cr = datacr[0]
try: