Merge lp:~gnuoy/charms/trusty/ceph-radosgw/stable-pkgrevno-from-charmhelpers into lp:~openstack-charmers-archive/charms/trusty/ceph-radosgw/trunk

Proposed by Liam Young
Status: Merged
Merged at revision: 24
Proposed branch: lp:~gnuoy/charms/trusty/ceph-radosgw/stable-pkgrevno-from-charmhelpers
Merge into: lp:~openstack-charmers-archive/charms/trusty/ceph-radosgw/trunk
Diff against target: 77 lines (+5/-19)
3 files modified
hooks/ceph.py (+0/-15)
hooks/hooks.py (+4/-3)
templates/ceph.conf (+1/-1)
To merge this branch: bzr merge lp:~gnuoy/charms/trusty/ceph-radosgw/stable-pkgrevno-from-charmhelpers
Reviewer Review Type Date Requested Status
Chris Glass (community) Approve
Review via email: mp+236093@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Chris Glass (tribaal) wrote :

This can be tested from cs:~tribaal/charms/trusty/ceph-radosgw-1

Revision history for this message
Chris Glass (tribaal) wrote :

This looks good! +1 provided Fernando adds a comment when his test run succeeds :)

review: Approve
Revision history for this message
Fernando Correa Neto (fcorrea) wrote :

Test run succeeded.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/ceph.py'
2--- hooks/ceph.py 2014-01-24 16:04:49 +0000
3+++ hooks/ceph.py 2014-09-26 09:33:40 +0000
4@@ -11,7 +11,6 @@
5 import subprocess
6 import time
7 import os
8-import apt_pkg as apt
9
10 from socket import gethostname as get_unit_hostname
11
12@@ -220,17 +219,3 @@
13 if 'key' in element:
14 key = element.split(' = ')[1].strip() # IGNORE:E1103
15 return key
16-
17-
18-def get_ceph_version(package=None):
19- apt.init()
20- cache = apt.Cache()
21- pkg = cache[package or 'ceph']
22- if pkg.current_ver:
23- return apt.upstream_version(pkg.current_ver.ver_str)
24- else:
25- return None
26-
27-
28-def version_compare(a, b):
29- return apt.version_compare(a, b)
30
31=== modified file 'hooks/hooks.py'
32--- hooks/hooks.py 2014-03-25 18:44:22 +0000
33+++ hooks/hooks.py 2014-09-26 09:33:40 +0000
34@@ -38,6 +38,7 @@
35 )
36
37 from charmhelpers.payload.execd import execd_preinstall
38+from charmhelpers.core.host import cmp_pkgrevno
39 from socket import gethostname as get_unit_hostname
40
41 hooks = Hooks()
42@@ -73,13 +74,13 @@
43 'auth_supported': get_auth() or 'none',
44 'mon_hosts': ' '.join(get_mon_hosts()),
45 'hostname': get_unit_hostname(),
46- 'version': ceph.get_ceph_version('radosgw'),
47+ 'old_auth': cmp_pkgrevno('radosgw', "0.51") < 0,
48 'use_syslog': str(config('use-syslog')).lower()
49 }
50
51 # Check to ensure that correct version of ceph is
52 # in use
53- if ceph.get_ceph_version('radosgw') >= "0.55":
54+ if cmp_pkgrevno('radosgw', '0.55') >= 0:
55 # Add keystone configuration if found
56 ks_conf = get_keystone_conf()
57 if ks_conf:
58@@ -208,7 +209,7 @@
59
60 @hooks.hook('identity-service-relation-joined')
61 def identity_joined(relid=None):
62- if ceph.get_ceph_version('radosgw') < "0.55":
63+ if cmp_pkgrevno('radosgw', '0.55') < 0:
64 log('Integration with keystone requires ceph >= 0.55')
65 sys.exit(1)
66
67
68=== modified file 'templates/ceph.conf'
69--- templates/ceph.conf 2014-03-25 18:44:22 +0000
70+++ templates/ceph.conf 2014-09-26 09:33:40 +0000
71@@ -1,5 +1,5 @@
72 [global]
73-{% if version < "0.51" %}
74+{% if old_auth %}
75 auth supported = {{ auth_supported }}
76 {% else %}
77 auth cluster required = {{ auth_supported }}

Subscribers

People subscribed via source and target branches