Use helper in hooks as well
This commit is contained in:
parent
8addd70182
commit
e4c6e44eae
|
@ -29,7 +29,8 @@ from charmhelpers.core.hookenv import (
|
|||
from charmhelpers.core.host import (
|
||||
service_restart,
|
||||
umount,
|
||||
mkdir
|
||||
mkdir,
|
||||
cmp_pkgrevno
|
||||
)
|
||||
from charmhelpers.fetch import (
|
||||
apt_install,
|
||||
|
@ -50,7 +51,7 @@ hooks = Hooks()
|
|||
|
||||
def install_upstart_scripts():
|
||||
# Only install upstart configurations for older versions
|
||||
if ceph.get_ceph_version() < "0.55.1":
|
||||
if cmp_pkgrevno('ceph', "0.55.1") < 0:
|
||||
for x in glob.glob('files/upstart/*.conf'):
|
||||
shutil.copy(x, '/etc/init/')
|
||||
|
||||
|
@ -71,7 +72,7 @@ def emit_cephconf():
|
|||
'auth_supported': config('auth-supported'),
|
||||
'mon_hosts': ' '.join(get_mon_hosts()),
|
||||
'fsid': config('fsid'),
|
||||
'version': ceph.get_ceph_version(),
|
||||
'old_auth': cmp_pkgrevno('ceph', "0.51") < 0,
|
||||
'osd_journal_size': config('osd-journal-size'),
|
||||
'use_syslog': str(config('use-syslog')).lower()
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[global]
|
||||
{% if version < "0.51" %}
|
||||
{% if old_auth %}
|
||||
auth supported = {{ auth_supported }}
|
||||
{% else %}
|
||||
auth cluster required = {{ auth_supported }}
|
||||
|
|
Loading…
Reference in New Issue