[server/migractions] finish migration to repoapi objects
Changeset 241b1232ed7f (Use repoapi instead of dbapi for cwctl shell,
upgrade and db-init) only did half of the job. It left the migration
handler with both a session (cubicweb.server.session.Session) and a cnx
(cubicweb.repoapi.ClientConnection) attribute with different ideas of
what Connection they were talking to.
With this change, we:
- make the caller responsible of disabling security on the Connection if
it wants to
- turn mih.session into an actual attribute, set on __init__
- same for cnx (the client connection)
- drop the "lazy connection" logic, and establish the connection
up-front
- always go through the connection instead of the session when we need
to talk to the db
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: cubicweb
# Required-Start: $remote_fs $syslog $local_fs $network
# Required-Stop: $remote_fs $syslog $local_fs $network
# Should-Start: postgresql pyro-nsd
# Should-Stop: postgresql pyro-nsd
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start cubicweb application at boot time
### END INIT INFO
# FIXME Seems to be inadequate here
# FIXME If related to pyro, try instead:
# export PYRO_STORAGE="/tmp"
cd /tmp
# FIXME Work-around about the following lintian error
# E: cubicweb-ctl: init.d-script-does-not-implement-required-option /etc/init.d/cubicweb start
#
# Check if we are sure to not want the start-stop-daemon machinery here
# Refer to Debian Policy Manual section 9.3.2 (Writing the scripts) for details.
case $1 in
force-reload)
python -W ignore /usr/bin/cubicweb-ctl reload --force
;;
status)
python -W ignore /usr/bin/cubicweb-ctl status
;;
start|stop|restart|*)
python -W ignore /usr/bin/cubicweb-ctl $1 --force
;;
esac