~gandelman-a/charms/quantal/nova-compute/proposed

« back to all changes in this revision

Viewing changes to hooks/nova-compute-relations

  • Committer: Adam Gandelman
  • Date: 2012-01-23 23:00:00 UTC
  • mfrom: (28.1.7 nova-compute)
  • Revision ID: adamg@canonical.com-20120123230000-p9okda1gc1z6gr2b
MergeĀ lp:~gandelman-a/charms/precise/nova-compute/trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
function install_hook {
12
12
  [[ -z $VIRT_TYPE ]] && VIRT_TYPE="kvm"
13
13
  case $VIRT_TYPE in
14
 
    "kvm") COMPUTE_PKG="nova-compute-kvm";;
 
14
    "kvm"|"qemu") COMPUTE_PKG="nova-compute-kvm";;
15
15
    "xen") COMPUTE_PKG="nova-compute-xen";;
16
16
    "uml") COMPUTE_PKG="nova-compute-uml";;
17
17
    "lxc") COMPUTE_PKG="nova-compute-lxc";;
20
20
  apt-get -y install python-software-properties || exit 1
21
21
  add_ppa
22
22
  apt-get update || exit 1
23
 
  apt-get -y install $COMPUTE_PKG nova-network || exit 1
 
23
  apt-get -y install $COMPUTE_PKG nova-api nova-network || exit 1
 
24
 
 
25
  # there is no nova-compute-qemu pkg. Install kvm and reconfigure
 
26
  # manually for qemu.
 
27
  if [[ "$VIRT_TYPE" == "qemu" ]] ; then
 
28
    sed -i 's/\(\-\-libvirt_type=\).*/\1qemu/g' /etc/nova/nova-compute.conf
 
29
  fi
24
30
 
25
31
  # XXX sudo on the juju sample AMI doesnt function
26
32
  # as it should (doesn't include suoders.d/*). do this
71
77
}
72
78
 
73
79
function db_changed {
74
 
  DB_HOST=`relation-get db_host`
 
80
  DB_HOST=`relation-get private-address`
75
81
  DB_PASSWORD=`relation-get password`
76
82
  if [[ -z $DB_HOST ]] || [[ -z $DB_PASSWORD ]] ; then
77
83
    echo "db_changed: DB_HOST || DB_PASSWORD not yet set. Exit 0 and retry"