Merge lp:~gandelman-a/charms/precise/nova-cloud-controller/fixes into lp:~charmers/charms/precise/nova-cloud-controller/trunk

Proposed by Adam Gandelman
Status: Merged
Merged at revision: 47
Proposed branch: lp:~gandelman-a/charms/precise/nova-cloud-controller/fixes
Merge into: lp:~charmers/charms/precise/nova-cloud-controller/trunk
Diff against target: 97 lines (+34/-4)
2 files modified
hooks/lib/openstack-common (+14/-1)
hooks/nova-cloud-controller-relations (+20/-3)
To merge this branch: bzr merge lp:~gandelman-a/charms/precise/nova-cloud-controller/fixes
Reviewer Review Type Date Requested Status
Juan L. Negron (community) Approve
Review via email: mp+136821@code.launchpad.net

Description of the change

* Some fixes for handling of repo URLs via 'openstack-origin' config. Courtesy of James Page.

* Allows the nova-cloud-controller service to inform nova-compute, via the cloud-compute relation, of the configured volume service so nova-compute can configure itself accordingly. The volume service changes depending on what has been deployed and related (nova-volume or cinder).

I seem to have lost write access to these branches to merge myself.

To post a comment you must log in.
Revision history for this message
Juan L. Negron (negronjl) wrote :

Reviewing this now.

-Juan

Revision history for this message
Juan L. Negron (negronjl) wrote :

I fixed the ensemble left-overs from metadata.yaml.

charm proof results:
W: no README file
I: relation cloud-controller has no hooks

The README file should be added to this ... Adam? :)

Other than that .. the changes are sane and seem to be working for me.

Approved.

Merging.

Thanks,

Juan

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/lib/openstack-common'
2--- hooks/lib/openstack-common 2012-10-12 19:37:13 +0000
3+++ hooks/lib/openstack-common 2012-11-29 00:16:22 +0000
4@@ -78,7 +78,7 @@
5 juju-log "$CHARM No repository key specified"
6 url="$src"
7 fi
8- add-apt-repository -y "$url"
9+ echo $url > /etc/apt/sources.list.d/juju_deb.list
10 fi
11 return 0
12 fi
13@@ -129,6 +129,7 @@
14 "oneiric") codename="diablo" ;;
15 "precise") codename="essex" ;;
16 "quantal") codename="folsom" ;;
17+ "raring") codename="grizzly" ;;
18 esac
19 fi
20
21@@ -141,9 +142,21 @@
22 case "$ca_rel" in
23 "folsom"|"folsom/updates"|"folsom/proposed"|"folsom/staging")
24 codename="folsom" ;;
25+ "grizzly"|"grizzly/updates"|"grizzly/proposed"|"grizzy/staging")
26+ codename="grizly" ;;
27 esac
28 fi
29 fi
30+
31+ # have a guess based on the deb string provided
32+ if [[ "${rel:0:3}" == "deb" ]]; then
33+ CODENAMES="diablo essex folsom grizzly"
34+ for cname in $CODENAMES; do
35+ if echo $rel | grep -q $cname; then
36+ codename=$cname
37+ fi
38+ done
39+ fi
40 echo $codename
41 }
42
43
44=== modified file 'hooks/nova-cloud-controller-relations'
45--- hooks/nova-cloud-controller-relations 2012-10-12 19:37:13 +0000
46+++ hooks/nova-cloud-controller-relations 2012-11-29 00:16:22 +0000
47@@ -12,7 +12,7 @@
48 function install_hook {
49 juju-log "$CHARM: Installing nova packages"
50 apt-get -y install python-software-properties || exit 1
51- configure_install_source $(config-get openstack-origin)
52+ configure_install_source "$(config-get openstack-origin)"
53 apt-get update || exit 1
54
55 DEBIAN_FRONTEND=noninteractive apt-get -y \
56@@ -220,8 +220,8 @@
57 # configured in keystone.
58 if [[ "$svc" == "nova-volume" ]] ; then
59 apt-get -y install nova-api-os-volume
60- nova_vol_url="http://$(unit-get private-address):8776/v1/\$(tenant_id)s"
61- r_ids=$(relation-ids identity-service)
62+ local nova_vol_url="http://$(unit-get private-address):8776/v1/\$(tenant_id)s"
63+ local r_ids=$(relation-ids identity-service)
64 for id in $r_ids ; do
65 juju-log "$CHARM: Registering new endpoint for nova-volume API on "\
66 "existing identity-service relation: $id"
67@@ -233,6 +233,15 @@
68 nova-volume_internal_url="$nova_vol_url"
69 done
70 fi
71+
72+ if [[ "$svc" == "cinder" ]] ; then
73+ # Compute nodes need to be notified to set their volume
74+ # driver accordingly.
75+ r_ids=$(relation-ids cloud-compute)
76+ for id in $r_ids ; do
77+ relation-set -r $id volume_service="cinder"
78+ done
79+ fi
80 }
81
82 compute_joined() {
83@@ -240,6 +249,14 @@
84 # nova-compute should configure itself accordingly.
85 relation-set network_manager=$(config-get network-manager)
86 relation-set ec2_host=$(unit-get private-address)
87+
88+ # Compute's volume driver is dependent on volume service deployed.
89+ local r_ids=$(relation-ids cinder-volume-service)
90+ if [[ -n "$r_ids" ]] ; then
91+ relation-set volume_service="cinder"
92+ else
93+ relation-set volume_service="nova-volume"
94+ fi
95 }
96
97 arg0=$(basename $0)

Subscribers

People subscribed via source and target branches