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
1=== modified file 'hooks/nova-compute-common'
2--- hooks/nova-compute-common 2013-05-20 11:28:14 +0000
3+++ hooks/nova-compute-common 2013-05-21 05:28:05 +0000
4@@ -127,19 +127,31 @@
5 set_or_update ec2_dmz_host $ec2_host
6 ;;
7 "Quantum")
8- local keystone_host=$(relation-get keystone_host)
9- [[ -z $keystone_host ]] && juju-log "nova-compute: Missing keystone host" \
10- && exit 0
11- # XXX(adam_g): Need to check for unset values here, otherwise it errors
12- # if nova-c-c<->nova-compute is made before keystone<->nova-c-c
13+ local keystone_host="$(relation-get keystone_host)"
14+ local auth_port="$(relation-get auth_port)"
15+ local quantum_url="$(relation-get quantum_url)"
16+ local quantum_admin_tenant_name="$(relation-get service_tenant)"
17+ local quantum_admin_username="$(relation-get service_username)"
18+ local quantum_admin_password="$(relation-get service_password)"
19+
20+ # might end up here before nova-c-c has processed keystone hooks
21+ [[ -z "$keystone_host" ]] ||
22+ [[ -z "$auth_port" ]] ||
23+ [[ -z "$quantum_url" ]] ||
24+ [[ -z "$quantum_admin_tenant_name" ]] ||
25+ [[ -z "$quantum_admin_username" ]] ||
26+ [[ -z "$quantum_admin_password" ]] &&
27+ juju-log "nova-compute: Missing required data for Quantum config." &&
28+ exit 0
29 set_or_update "network_api_class" "nova.network.quantumv2.api.API"
30 set_or_update "quantum_auth_strategy" "keystone"
31- set_or_update "quantum_url" "$(relation-get quantum_url)"
32- set_or_update "quantum_admin_tenant_name" "$(relation-get service_tenant)"
33- set_or_update "quantum_admin_username" "$(relation-get service_username)"
34- set_or_update "quantum_admin_password" "$(relation-get service_password)"
35+ set_or_update "quantum_url" "$quantum_url"
36+ set_or_update "quantum_admin_tenant_name" "$quantum_admin_tenant_name"
37+ set_or_update "quantum_admin_username" "$quantum_admin_username"
38+ set_or_update "quantum_admin_password" "$quantum_admin_password"
39 set_or_update "quantum_admin_auth_url" \
40- "http://$(relation-get keystone_host):$(relation-get auth_port)/v2.0"
41+ "http://$keystone_host:$auth_port/v2.0"
42+
43 local cur=$(get_os_codename_package "nova-common")
44 if dpkg --compare-versions $(get_os_version_codename $cur) gt '2012.2'; then
45 # Grizzly onwards supports metadata proxy so forcing use of config

Subscribers

People subscribed via source and target branches