Support cloud:precise-folsom/staging installation source.

This commit is contained in:
Adam Gandelman 2012-10-10 12:45:34 -07:00
parent 084bb19682
commit f0a780e704
2 changed files with 20 additions and 1 deletions

View File

@ -45,6 +45,19 @@ function service_ctl {
done
}
function conditional_service_restart {
# restart specified service ($1) if contents of file differ from $2
local svc="$1"
local new_contents="$2"
local file="/var/lib/juju/$CHARM-restart"
if [[ -e "$file" ]] && [[ "$(cat $file)" == "$new_contents" ]] ; then
juju-log "$CHARM: Skipping conditional restart, not needed."
return 0
fi
echo "$new_contents" >$file
service_ctl "$svc" restart
}
function configure_install_source {
# Setup and configure installation source based on a config flag.
local src="$1"
@ -94,6 +107,12 @@ function configure_install_source {
error_out "Cannot install from Cloud Archive pocket $src " \
"on this Ubuntu version ($DISTRIB_CODENAME)!"
if [[ "$ca_rel" == "folsom/staging" ]] ; then
# cloud archive staging is just a regular PPA.
add-apt-repository -y ppa:ubuntu-cloud-archive/folsom-staging
return 0
fi
case "$ca_rel" in
"folsom"|"folsom/updates") pocket="precise-updates/folsom" ;;
"folsom/proposed") pocket="precise-proposed/folsom" ;;

View File

@ -1 +1 @@
66
67