Merge lp:~gandelman-a/charms/precise/nova-compute/early_keystone into lp:~openstack-charmers/charms/precise/nova-compute/ha-support

Proposed by Adam Gandelman
Status: Merged
Merged at revision: 60
Proposed branch: lp:~gandelman-a/charms/precise/nova-compute/early_keystone
Merge into: lp:~openstack-charmers/charms/precise/nova-compute/ha-support
Diff against target: 45 lines (+22/-10)
1 file modified
hooks/nova-compute-common (+22/-10)
To merge this branch: bzr merge lp:~gandelman-a/charms/precise/nova-compute/early_keystone
Reviewer Review Type Date Requested Status
James Page Approve
Review via email: mp+164836@code.launchpad.net

Description of the change

If nova-cloud-controller is running cloud-compute-relation-* before its executed any identity-service changed, nova-c-c will not pass all required data for quantuam config via the cloud-compute relation. Ensure we have everything we need before attempting to set_or_update various identity service bits.

To post a comment you must log in.
Revision history for this message
James Page (james-page) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hooks/nova-compute-common'
--- hooks/nova-compute-common 2013-05-20 11:28:14 +0000
+++ hooks/nova-compute-common 2013-05-21 05:28:05 +0000
@@ -127,19 +127,31 @@
127 set_or_update ec2_dmz_host $ec2_host127 set_or_update ec2_dmz_host $ec2_host
128 ;;128 ;;
129 "Quantum")129 "Quantum")
130 local keystone_host=$(relation-get keystone_host)130 local keystone_host="$(relation-get keystone_host)"
131 [[ -z $keystone_host ]] && juju-log "nova-compute: Missing keystone host" \131 local auth_port="$(relation-get auth_port)"
132 && exit 0132 local quantum_url="$(relation-get quantum_url)"
133 # XXX(adam_g): Need to check for unset values here, otherwise it errors133 local quantum_admin_tenant_name="$(relation-get service_tenant)"
134 # if nova-c-c<->nova-compute is made before keystone<->nova-c-c134 local quantum_admin_username="$(relation-get service_username)"
135 local quantum_admin_password="$(relation-get service_password)"
136
137 # might end up here before nova-c-c has processed keystone hooks
138 [[ -z "$keystone_host" ]] ||
139 [[ -z "$auth_port" ]] ||
140 [[ -z "$quantum_url" ]] ||
141 [[ -z "$quantum_admin_tenant_name" ]] ||
142 [[ -z "$quantum_admin_username" ]] ||
143 [[ -z "$quantum_admin_password" ]] &&
144 juju-log "nova-compute: Missing required data for Quantum config." &&
145 exit 0
135 set_or_update "network_api_class" "nova.network.quantumv2.api.API"146 set_or_update "network_api_class" "nova.network.quantumv2.api.API"
136 set_or_update "quantum_auth_strategy" "keystone"147 set_or_update "quantum_auth_strategy" "keystone"
137 set_or_update "quantum_url" "$(relation-get quantum_url)"148 set_or_update "quantum_url" "$quantum_url"
138 set_or_update "quantum_admin_tenant_name" "$(relation-get service_tenant)"149 set_or_update "quantum_admin_tenant_name" "$quantum_admin_tenant_name"
139 set_or_update "quantum_admin_username" "$(relation-get service_username)"150 set_or_update "quantum_admin_username" "$quantum_admin_username"
140 set_or_update "quantum_admin_password" "$(relation-get service_password)"151 set_or_update "quantum_admin_password" "$quantum_admin_password"
141 set_or_update "quantum_admin_auth_url" \152 set_or_update "quantum_admin_auth_url" \
142 "http://$(relation-get keystone_host):$(relation-get auth_port)/v2.0"153 "http://$keystone_host:$auth_port/v2.0"
154
143 local cur=$(get_os_codename_package "nova-common")155 local cur=$(get_os_codename_package "nova-common")
144 if dpkg --compare-versions $(get_os_version_codename $cur) gt '2012.2'; then156 if dpkg --compare-versions $(get_os_version_codename $cur) gt '2012.2'; then
145 # Grizzly onwards supports metadata proxy so forcing use of config157 # Grizzly onwards supports metadata proxy so forcing use of config

Subscribers

People subscribed via source and target branches