~gandelman-a/charms/oneiric/glance/custom_ppa

« back to all changes in this revision

Viewing changes to hooks/glance-common

  • Committer: Adam Gandelman
  • Date: 2011-08-15 17:40:13 UTC
  • Revision ID: adamg@canonical.com-20110815174013-p06qeujhzfg3mnk5
Use config-et

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/bash
2
2
 
3
3
SERVICES="glance-api glance-registry"
4
 
GLANCE_REGISTRY_CONF="/etc/glance/glance-registry.conf"
5
 
GLANCE_API_CONF="/etc/glance/glance-api.conf"
 
4
GLANCE_REGISTRY_CONF=$(config-get registry-config)
 
5
GLANCE_API_CONF=$(config-get api-config)
6
6
 
7
 
DB_USER="glance"
8
 
NOVA_DB="nova"
 
7
DB_USER=$(config-get db-user)
 
8
NOVA_DB=$(config-get nova-db)
 
9
PPA=$(config-get glance-release)
9
10
 
10
11
HOSTNAME=`hostname -f`
11
12
 
68
69
  fi
69
70
}
70
71
 
71
 
function add_glance_ppa {
72
 
  # temporarily find out what nova version we
73
 
  # should be using from a source file.  this
74
 
  # should go away when ensemble can handle config
75
 
  # better.
76
 
  if [[ -e $FORMULA_DIR/nova-version ]] ; then
77
 
    . $FORMULA_DIR/nova-version
78
 
    . /etc/lsb-release
79
 
    [[ -z $PPA ]] && return 0
80
 
    PPA_URL="deb http://ppa.launchpad.net/nova-core/$PPA/ubuntu $DISTRIB_CODENAME main"
81
 
    add-apt-repository "$PPA_URL" || exit 1
82
 
  fi
 
72
function add_ppa {
 
73
  # Install from archive instead of PPA.
 
74
  [[ $PPA == "distro" ]] && return 0
 
75
  . /etc/lsb-release
 
76
  ensemble-log "glance: Setting up PPA for $PPA"
 
77
  [[ -z $PPA ]] && return 0
 
78
  PPA_URL="deb http://ppa.launchpad.net/nova-core/$PPA/ubuntu $DISTRIB_CODENAME main"
 
79
  add-apt-repository "$PPA_URL" || exit 1
83
80
}