e62bf60096
What works: - All the add/delete/update APIs integrated with UI and tested end to end - Basic unit tests that test the above metioned APIs. What (may) not be working or in other words is not fully tested - Actual deletes of the VM, it used to work, but code has gone through major changes so need to test again. - Cases: -- Making sure Override of the lease works. -- Cases where VM changes tenants or is deleted before the lease expiry -- Removal of the tenant (not tested at all) Next steps: - Better unit test cases - better verification - Deployment scripts (Ansible playbooks) Adding a manage script for managing database upgrade script Adding manage.py
101 lines
1.7 KiB
Bash
Executable File
101 lines
1.7 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# chkconfig: - 98 02
|
|
# description: Platform9 Lease Manager (code -named Mors)
|
|
|
|
### BEGIN INIT INFO
|
|
# Provides: pf9-mors
|
|
# Required-Start: $remote_fs $network $syslog
|
|
# Required-Stop: $remote_fs $syslog
|
|
# Default-Stop: 0 1 6
|
|
# Short-Description: Mors Server
|
|
# Description: Platform9 Lease Manager (code -named Mors)
|
|
### END INIT INFO
|
|
|
|
. /etc/rc.d/init.d/functions
|
|
|
|
name=pf9-mors
|
|
prog=pf9-mors
|
|
bindir=/opt/pf9/$name/bin
|
|
python=$bindir/python
|
|
exec="$python $bindir/pf9_mors.py"
|
|
pidfile="/var/run/$name.pid"
|
|
log_stdout="/var/log/pf9/$name-out.log"
|
|
|
|
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
|
|
|
|
lockfile=/var/lock/subsys/$prog
|
|
|
|
start() {
|
|
[ -x $python ] || exit 5
|
|
echo -n $"Starting $prog: "
|
|
daemon --pidfile $pidfile "$exec >> $log_stdout 2>&1 & echo \$! > $pidfile"
|
|
retval=$?
|
|
echo
|
|
[ $retval -eq 0 ] && touch $lockfile
|
|
return $retval
|
|
}
|
|
|
|
stop() {
|
|
echo -n $"Stopping $prog: "
|
|
killproc -p $pidfile $prog
|
|
retval=$?
|
|
echo
|
|
[ $retval -eq 0 ] && rm -f $lockfile
|
|
return $retval
|
|
}
|
|
|
|
restart() {
|
|
stop
|
|
start
|
|
}
|
|
|
|
reload() {
|
|
restart
|
|
}
|
|
|
|
force_reload() {
|
|
restart
|
|
}
|
|
|
|
rh_status() {
|
|
status -p $pidfile $prog
|
|
}
|
|
|
|
rh_status_q() {
|
|
rh_status >/dev/null 2>&1
|
|
}
|
|
|
|
|
|
case "$1" in
|
|
start)
|
|
rh_status_q && exit 0
|
|
$1
|
|
;;
|
|
stop)
|
|
rh_status_q || exit 0
|
|
$1
|
|
;;
|
|
restart)
|
|
$1
|
|
;;
|
|
reload)
|
|
rh_status_q || exit 7
|
|
$1
|
|
;;
|
|
force-reload)
|
|
force_reload
|
|
;;
|
|
status)
|
|
rh_status
|
|
;;
|
|
condrestart|try-restart)
|
|
rh_status_q || exit 0
|
|
restart
|
|
;;
|
|
*)
|
|
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
|
|
exit 2
|
|
esac
|
|
exit $?
|