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
=== modified file 'hooks/ceph.py'
--- hooks/ceph.py 2014-01-24 16:04:49 +0000
+++ hooks/ceph.py 2014-09-26 09:33:40 +0000
@@ -11,7 +11,6 @@
11import subprocess11import subprocess
12import time12import time
13import os13import os
14import apt_pkg as apt
1514
16from socket import gethostname as get_unit_hostname15from socket import gethostname as get_unit_hostname
1716
@@ -220,17 +219,3 @@
220 if 'key' in element:219 if 'key' in element:
221 key = element.split(' = ')[1].strip() # IGNORE:E1103220 key = element.split(' = ')[1].strip() # IGNORE:E1103
222 return key221 return key
223
224
225def get_ceph_version(package=None):
226 apt.init()
227 cache = apt.Cache()
228 pkg = cache[package or 'ceph']
229 if pkg.current_ver:
230 return apt.upstream_version(pkg.current_ver.ver_str)
231 else:
232 return None
233
234
235def version_compare(a, b):
236 return apt.version_compare(a, b)
237222
=== modified file 'hooks/hooks.py'
--- hooks/hooks.py 2014-03-25 18:44:22 +0000
+++ hooks/hooks.py 2014-09-26 09:33:40 +0000
@@ -38,6 +38,7 @@
38)38)
3939
40from charmhelpers.payload.execd import execd_preinstall40from charmhelpers.payload.execd import execd_preinstall
41from charmhelpers.core.host import cmp_pkgrevno
41from socket import gethostname as get_unit_hostname42from socket import gethostname as get_unit_hostname
4243
43hooks = Hooks()44hooks = Hooks()
@@ -73,13 +74,13 @@
73 'auth_supported': get_auth() or 'none',74 'auth_supported': get_auth() or 'none',
74 'mon_hosts': ' '.join(get_mon_hosts()),75 'mon_hosts': ' '.join(get_mon_hosts()),
75 'hostname': get_unit_hostname(),76 'hostname': get_unit_hostname(),
76 'version': ceph.get_ceph_version('radosgw'),77 'old_auth': cmp_pkgrevno('radosgw', "0.51") < 0,
77 'use_syslog': str(config('use-syslog')).lower()78 'use_syslog': str(config('use-syslog')).lower()
78 }79 }
7980
80 # Check to ensure that correct version of ceph is81 # Check to ensure that correct version of ceph is
81 # in use82 # in use
82 if ceph.get_ceph_version('radosgw') >= "0.55":83 if cmp_pkgrevno('radosgw', '0.55') >= 0:
83 # Add keystone configuration if found84 # Add keystone configuration if found
84 ks_conf = get_keystone_conf()85 ks_conf = get_keystone_conf()
85 if ks_conf:86 if ks_conf:
@@ -208,7 +209,7 @@
208209
209@hooks.hook('identity-service-relation-joined')210@hooks.hook('identity-service-relation-joined')
210def identity_joined(relid=None):211def identity_joined(relid=None):
211 if ceph.get_ceph_version('radosgw') < "0.55":212 if cmp_pkgrevno('radosgw', '0.55') < 0:
212 log('Integration with keystone requires ceph >= 0.55')213 log('Integration with keystone requires ceph >= 0.55')
213 sys.exit(1)214 sys.exit(1)
214215
215216
=== modified file 'templates/ceph.conf'
--- templates/ceph.conf 2014-03-25 18:44:22 +0000
+++ templates/ceph.conf 2014-09-26 09:33:40 +0000
@@ -1,5 +1,5 @@
1[global]1[global]
2{% if version < "0.51" %}2{% if old_auth %}
3 auth supported = {{ auth_supported }}3 auth supported = {{ auth_supported }}
4{% else %}4{% else %}
5 auth cluster required = {{ auth_supported }}5 auth cluster required = {{ auth_supported }}

Subscribers

People subscribed via source and target branches