Merge lp:~jaywink/charms/trusty/block-storage-broker/fix-for-trusty into lp:~lazypower/charms/trusty/block-storage-broker/trunk

Proposed by Jason Robinson
Status: Needs review
Proposed branch: lp:~jaywink/charms/trusty/block-storage-broker/fix-for-trusty
Merge into: lp:~lazypower/charms/trusty/block-storage-broker/trunk
Diff against target: 54 lines (+19/-3)
2 files modified
hooks/hooks.py (+3/-2)
hooks/util.py (+16/-1)
To merge this branch: bzr merge lp:~jaywink/charms/trusty/block-storage-broker/fix-for-trusty
Reviewer Review Type Date Requested Status
Charles Butler Pending
Review via email: mp+229274@code.launchpad.net

Description of the change

Fixes relating to trusty have been made to the precise charm. Merged them in to this trusty branch. Tested charm works now on trusty too.

To post a comment you must log in.
Revision history for this message
Jason Robinson (jaywink) wrote :

Hmm it seems bazaar doesn't keep the actual commits (2x) which I merged in. Maybe you could merge them in to trusty/block-storage-broker/trunk directly, instead of this?

Unmerged revisions

53. By Jason Robinson

Merge fixes to allow running on trusty

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/hooks.py'
2--- hooks/hooks.py 2014-03-21 17:38:30 +0000
3+++ hooks/hooks.py 2014-08-01 19:37:46 +0000
4@@ -7,7 +7,7 @@
5 import json
6 import os
7 import sys
8-from util import StorageServiceUtil, generate_volume_label
9+from util import StorageServiceUtil, generate_volume_label, get_running_series
10
11 hooks = hookenv.Hooks()
12
13@@ -83,7 +83,8 @@
14 provider = hookenv.config("provider")
15 if provider == "nova":
16 required_packages = ["python-novaclient"]
17- fetch.add_source("cloud-archive:havana")
18+ if int(get_running_series()['release'].split(".")[0]) < 14:
19+ fetch.add_source("cloud-archive:havana")
20 elif provider == "ec2":
21 required_packages = ["euca2ools"]
22 fetch.apt_update(fatal=True)
23
24=== modified file 'hooks/util.py'
25--- hooks/util.py 2014-03-21 17:39:48 +0000
26+++ hooks/util.py 2014-08-01 19:37:46 +0000
27@@ -373,7 +373,7 @@
28 continue
29 (_, key, value, _) = line.split("|")
30 key = key.strip()
31- value = value.strip()
32+ value = value.replace("null", "None").strip()
33 if key in ["availability_zone", "size", "id", "snapshot_id",
34 "status"]:
35 result[key] = value
36@@ -470,3 +470,18 @@
37 def generate_volume_label(remote_unit):
38 """Create a volume label for the requesting remote unit"""
39 return "%s unit volume" % remote_unit
40+
41+
42+def get_running_series():
43+ lsb_release = "/etc/lsb-release"
44+ series = {}
45+ with open(lsb_release) as f:
46+ for line in f:
47+ line = line.strip()
48+ if line.startswith('DISTRIB_CODENAME'):
49+ series['codename'] = line.split('=')[1]
50+ if line.startswith('DISTRIB_RELEASE'):
51+ series['release'] = line.split('=')[1]
52+ if line.startswith('DISTRIB_DESCRIPTION'):
53+ series['description'] = line.split('=')[1]
54+ return series

Subscribers

People subscribed via source and target branches

to all changes: