diff --git a/hooks/swift-storage-node-relations b/hooks/swift-storage-node-relations index f6c8f1c..cf1b409 100755 --- a/hooks/swift-storage-node-relations +++ b/hooks/swift-storage-node-relations @@ -12,7 +12,17 @@ else fi function config_changed { - + # perform openstack upgrade if openstack-origin has been bumped. + local install_src=$(config-get openstack-origin) + local cur=$(get_os_codename_package "glance-common") + local available=$(get_os_codename_install_source "$install_src") + if [[ "$available" != "unknown" ]] ; then + if dpkg --compare-versions $(get_os_version_codename "$cur") lt \ + $(get_os_version_codename "$available") ; then + juju-log "$CHARM: Upgrading OpenStack release: $cur -> $available." + do_openstack_upgrade "$install_src" $PACKAGES + fi + fi declare -a env_vars=() for i in account container object ; do port=$(config-get ${i}-server-port) @@ -29,7 +39,7 @@ function config_changed { # Save our scriptrc env variables for health checks save_script_rc ${env_vars[@]} -} +} function install_hook { apt-get -y --force-yes install python-software-properties || exit 1 @@ -83,19 +93,6 @@ function storage_changed { swift-init all start || true } -function config_changed { - local install_src=$(config-get openstack-origin) - local cur=$(get_os_codename_package "glance-common") - local available=$(get_os_codename_install_source "$install_src") - if [[ "$available" != "unknown" ]] ; then - if dpkg --compare-versions $(get_os_version_codename "$cur") lt \ - $(get_os_version_codename "$available") ; then - juju-log "$CHARM: Upgrading OpenStack release: $cur -> $available." - do_openstack_upgrade "$install_src" $PACKAGES - fi - fi -} - case $ARG0 in "install") install_hook ;; "start"|"stop") exit 0 ;; diff --git a/revision b/revision index 8c61d23..04f9fe4 100644 --- a/revision +++ b/revision @@ -1 +1 @@ -58 +59