if not cr.fetchone():
continue
- cr.execute("SELECT id FROM ir_module_module WHERE name = 'document_ftp' AND state IN ('installed', 'to upgrade') ")
+ cr.execute("SELECT id FROM ir_module_module WHERE name = 'document_ftp' AND state IN ('installed', 'to install', 'to upgrade') ")
res = cr.fetchone()
if res and len(res):
self.db_name_list.append(db_name)
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:
raise IOError(errno.EPERM, 'Cannot perform operation at root dir')
dbname = p_parts[0]
if dbname not in self.db_list():
- raise IOError(errno.ENOENT,'Invalid database path')
+ raise IOError(errno.ENOENT,'Invalid database path: %s' % dbname)
try:
db = pooler.get_db(dbname)
except Exception:
"""Remove the specified directory."""
cr, node, rem = datacr
assert node
- cr = self.get_node_cr(node)
node.rmcol(cr)
cr.commit()
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: