throw away prototype hooks, add hooks.py (stubs only atm)
This commit is contained in:
parent
3e55c31017
commit
d1940639ef
|
@ -0,0 +1,39 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
#
|
||||
# Copyright 2012 Canonical Ltd.
|
||||
#
|
||||
# Authors:
|
||||
# Paul Collins <paul.collins@canonical.com>
|
||||
#
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
def install():
|
||||
print "install"
|
||||
|
||||
def config_changed():
|
||||
print "config_changed"
|
||||
|
||||
def mon_relation():
|
||||
print "mon_relation"
|
||||
|
||||
hooks = {
|
||||
'mon-relation-joined': mon_relation,
|
||||
'mon-relation-changed': mon_relation,
|
||||
'mon-relation-departed': mon_relation,
|
||||
'install': install,
|
||||
'config-changed': config_changed,
|
||||
}
|
||||
|
||||
hook = os.path.basename(sys.argv[0])
|
||||
|
||||
try:
|
||||
hooks[hook]()
|
||||
except:
|
||||
subprocess.call(['juju-log', '-l', 'INFO',
|
||||
"This charm doesn't know how to handle '%s'." % hook])
|
||||
|
||||
sys.exit(0)
|
|
@ -1,19 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -u
|
||||
|
||||
# set up ceph package source
|
||||
# XXX make this a charm config option
|
||||
cat >/etc/apt/sources.list.d/ceph-brolin.list <<EOF
|
||||
deb http://archive.admin.canonical.com/ubuntu precise-cat-ceph main
|
||||
EOF
|
||||
|
||||
apt-get update
|
||||
|
||||
apt-get -y install ceph
|
||||
|
||||
# ceph-prepare-disk uses this, is only "suggests" in the package
|
||||
apt-get -y install gdisk
|
||||
|
||||
exit 0
|
|
@ -0,0 +1 @@
|
|||
hooks.py
|
|
@ -1,5 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
set -u
|
||||
|
|
@ -1 +1 @@
|
|||
mon-relation
|
||||
hooks.py
|
|
@ -1 +1 @@
|
|||
mon-relation
|
||||
hooks.py
|
|
@ -1 +1 @@
|
|||
mon-relation
|
||||
hooks.py
|
Loading…
Reference in New Issue