Support cloud:precise-folsom/staging installation source.
This commit is contained in:
parent
084bb19682
commit
f0a780e704
|
@ -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" ;;
|
||||
|
|
Loading…
Reference in New Issue